mirror of
https://github.com/inspec/inspec
synced 2024-12-25 20:43:13 +00:00
85cbe713d7
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>
31 lines
654 B
Ruby
31 lines
654 B
Ruby
# encoding: utf-8
|
|
# author: Dominik Richter
|
|
# author: Christoph Hartmann
|
|
|
|
require 'helper'
|
|
|
|
describe Fetchers::Local do
|
|
let(:fetcher) { Fetchers::Local }
|
|
|
|
it 'registers with the fetchers registry' do
|
|
reg = Inspec::Fetcher.registry
|
|
_(reg['local']).must_equal fetcher
|
|
end
|
|
|
|
describe 'applied to this file' do
|
|
let(:res) { fetcher.resolve(__FILE__) }
|
|
|
|
it 'must be resolved' do
|
|
_(res).must_be_kind_of fetcher
|
|
end
|
|
end
|
|
|
|
describe 'applied to this folder' do
|
|
let(:path) { File.dirname(__FILE__) }
|
|
let(:res) { fetcher.resolve(path) }
|
|
|
|
it 'must be resolved' do
|
|
_(res).must_be_kind_of fetcher
|
|
end
|
|
end
|
|
end
|