inspec/test/unit/fetchers/mock_test.rb
Steven Danna 85cbe713d7
Add GitFetcher and rework Fetchers+SourceReaders
This adds a new git fetcher. In doing so, it also refactors how the
fetchers work a bit to better support fetchers that need to resolve
user-provided sources to fully specified sources appropriate for a
lockfile.

Signed-off-by: Steven Danna <steve@chef.io>
2016-09-09 14:14:36 +01:00

28 lines
563 B
Ruby

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann
require 'helper'
describe Fetchers::Mock do
let(:fetcher) { Fetchers::Mock }
it 'registers with the fetchers registry' do
reg = Inspec::Fetcher.registry
_(reg['mock']).must_equal fetcher
end
it 'wont load nil' do
fetcher.resolve(nil).must_be :nil?
end
it 'wont load a string' do
fetcher.resolve(rand.to_s).must_be :nil?
end
describe 'applied to a map' do
it 'must be resolved' do
fetcher.resolve({}).must_be_kind_of fetcher
end
end
end