2019-06-11 15:24:35 -07:00
|
|
|
require "helper"
|
2019-06-07 16:33:56 -07:00
|
|
|
require "inspec/fetcher"
|
2016-02-21 02:02:39 +01:00
|
|
|
|
2019-11-18 13:20:35 -05:00
|
|
|
describe Inspec::Fetcher::Local do
|
|
|
|
let(:fetcher) { Inspec::Fetcher::Local }
|
2016-02-21 02:02:39 +01:00
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "registers with the fetchers registry" do
|
2019-11-22 10:09:51 -05:00
|
|
|
reg = Inspec::Fetcher::Registry.registry
|
2019-06-11 15:24:35 -07:00
|
|
|
_(reg["local"]).must_equal fetcher
|
2016-02-21 02:02:39 +01:00
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
describe "applied to this file" do
|
2016-02-21 02:02:39 +01:00
|
|
|
let(:res) { fetcher.resolve(__FILE__) }
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "must be resolved" do
|
2016-02-21 02:02:39 +01:00
|
|
|
_(res).must_be_kind_of fetcher
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
describe "applied to this folder" do
|
2016-02-21 02:02:39 +01:00
|
|
|
let(:path) { File.dirname(__FILE__) }
|
|
|
|
let(:res) { fetcher.resolve(path) }
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "must be resolved" do
|
2016-02-21 02:02:39 +01:00
|
|
|
_(res).must_be_kind_of fetcher
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|