diff options
author | David Schmitt <david.schmitt@puppet.com> | 2017-02-21 14:01:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 14:01:04 +0000 |
commit | cd7575c46d4c85a68b1570d73663805b4218eea3 (patch) | |
tree | 6735770733158c3dd79ffcc15c8bd4d0f4f81f0a | |
parent | 8b510120701769258f8b58807953daaf3e73ced9 (diff) | |
parent | c2a41352b0a0338fcbdc54c5d3e722beb65c4dce (diff) |
Merge pull request #719 from domcleal/metadata-test-module
Allow test module metadata.json to be read
-rwxr-xr-x | spec/functions/load_module_metadata_spec.rb | 4 | ||||
-rw-r--r-- | spec/functions/loadjson_spec.rb | 4 |
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 |