inspec/test/unit/fetchers/mock_test.rb

26 lines
522 B
Ruby
Raw Normal View History

require "helper"
require "fetchers/mock"
2016-03-17 22:00:55 +00:00
describe Fetchers::Mock do
let(:fetcher) { Fetchers::Mock }
it "registers with the fetchers registry" do
2016-03-17 22:00:55 +00:00
reg = Inspec::Fetcher.registry
_(reg["mock"]).must_equal fetcher
2016-03-17 22:00:55 +00:00
end
it "wont load nil" do
_(fetcher.resolve(nil)).must_be :nil?
2016-03-17 22:00:55 +00:00
end
it "wont load a string" do
_(fetcher.resolve(rand.to_s)).must_be :nil?
2016-03-17 22:00:55 +00:00
end
describe "applied to a map" do
it "must be resolved" do
_(fetcher.resolve({})).must_be_kind_of fetcher
2016-03-17 22:00:55 +00:00
end
end
end