summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDominic Cleal <dominic@cleal.org>2017-02-04 16:45:03 +0100
committerDominic Cleal <dominic@cleal.org>2017-02-04 16:46:07 +0100
commitc2a41352b0a0338fcbdc54c5d3e722beb65c4dce (patch)
treee1bd5d4da3b4247b6d1d055636b59eb5120803fe /spec
parentdb8c1fbb2394d93fe3156b17c840455f1b3e2c76 (diff)
Allow test module metadata.json to be read
Since puppetlabs/puppet@f2e8e66, the test module's metadata.json is also read causing expectation failures. Like 5c51463, permit it to be read by Puppet.
Diffstat (limited to 'spec')
-rwxr-xr-xspec/functions/load_module_metadata_spec.rb4
-rw-r--r--spec/functions/loadjson_spec.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/functions/load_module_metadata_spec.rb b/spec/functions/load_module_metadata_spec.rb
index 2ba41a5..841cd7d 100755
--- a/spec/functions/load_module_metadata_spec.rb
+++ b/spec/functions/load_module_metadata_spec.rb
@@ -7,8 +7,8 @@ describe 'load_module_metadata' do
describe "when calling with valid arguments" do
before :each do
- allow(File).to receive(:read).with(/\/stdlib\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
- allow(File).to receive(:read).with(/\/stdlib\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
+ allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
+ allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
end
it "should json parse the file" do
if Puppet::Util::Platform.windows?
diff --git a/spec/functions/loadjson_spec.rb b/spec/functions/loadjson_spec.rb
index 9d26e93..26125bc 100644
--- a/spec/functions/loadjson_spec.rb
+++ b/spec/functions/loadjson_spec.rb
@@ -6,8 +6,8 @@ describe 'loadjson' do
describe "when calling with valid arguments" do
before :each do
- allow(File).to receive(:read).with(/\/stdlib\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
- allow(File).to receive(:read).with(/\/stdlib\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
+ allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
+ allow(File).to receive(:read).with(/\/(stdlib|test)\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
end
context 'when a non-existing file is specified' do