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