-
Notifications
You must be signed in to change notification settings - Fork 560
/
Copy pathdefault_formatter_spec.rb
29 lines (24 loc) · 1.07 KB
/
default_formatter_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true
require "helper"
require "simplecov_json_formatter"
describe SimpleCov::Formatter do
describe ".from_env" do
let(:env) { {"CC_TEST_REPORTER_ID" => "4c9f1de6193f30799e9a5d5c082692abecc1fd2c6aa62c621af7b2a910761970"} }
context "when CC_TEST_REPORTER_ID environment variable is set" do
it "returns an array containing the HTML and JSON formatters" do
expect(described_class.from_env(env)).to eq([
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter
])
end
end
context "when CC_TEST_REPORTER_ID environment variable isn't set" do
let(:env) { {} }
it "returns an array containing only the HTML formatter" do
expect(described_class.from_env(env)).to eq([
SimpleCov::Formatter::HTMLFormatter
])
end
end
end
end