diff options
author | Daniel O'Connor <daniel.oconnor@gmail.com> | 2014-08-03 17:35:46 +0930 |
---|---|---|
committer | Daniel O'Connor <daniel.oconnor@gmail.com> | 2014-08-03 17:35:46 +0930 |
commit | d604843c6151ea338bdb58521c62a779c3592312 (patch) | |
tree | b38c6f2233c8c0e8440754d81dfd512b46a8fadb /spec/unit/role_spec.rb | |
parent | 0e5952187e11d0f0264d2841fa0246c7f5f28c81 (diff) | |
download | chef-d604843c6151ea338bdb58521c62a779c3592312.tar.gz |
#1739 - Add explicit test
Diffstat (limited to 'spec/unit/role_spec.rb')
-rw-r--r-- | spec/unit/role_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb index 9ff75566b4..05ebf282db 100644 --- a/spec/unit/role_spec.rb +++ b/spec/unit/role_spec.rb @@ -296,6 +296,12 @@ EOR File.should_not_receive(:exists?) lambda {@role.class.from_disk("lolcat")}.should raise_error(Chef::Exceptions::DuplicateRole) end + + it "should not raise an exception if two files exist with a similar name" do + Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/super_lolcat.rb"]) + File.should_not_receive(:exists?) + lambda {@role.class.from_disk("lolcat")}.should_not raise_error(Chef::Exceptions::DuplicateRole) + end end describe "when loading from disk and role_path is an array" do |