condense true/false enabled tests

Because of the way the test system loads I cannot guarantee that
`Inspec::Config.cached` won't be nil. I have to always pass in a mock
config object with our setting.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-05-07 19:06:38 -07:00
parent ea0643cc14
commit 0b9833dd96

View file

@ -41,13 +41,10 @@ class TestTelemetryCollector < Minitest::Test
assert_equal 0, @collector.list_data_series.count
end
def test_telemetry_disabled
@collector.load_config(Inspec::Config.mock(telemetry: false))
refute @collector.telemetry_enabled?
end
def test_telemetry_enabled
@collector.load_config(Inspec::Config.mock(telemetry: true))
@collector.load_config(Inspec::Config.mock("enable_telemetry"=>false))
refute @collector.telemetry_enabled?
@collector.load_config(Inspec::Config.mock("enable_telemetry"=>true))
assert @collector.telemetry_enabled?
end
end