diff options
author | jkeiser <jkeiser@opscode.com> | 2013-01-11 21:36:33 -0800 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-06-07 13:12:19 -0700 |
commit | 1f7699afbb0dd76c33aa81304cf0e57bf65f312d (patch) | |
tree | de73c7e0362720eff3d2533fb016d0239c91f6d1 /spec/unit/chef_fs | |
parent | 1ad06967ee2480a64a19857264e4ac530578df81 (diff) | |
download | chef-1f7699afbb0dd76c33aa81304cf0e57bf65f312d.tar.gz |
Fix unit test to match new cookbook retrieval
Diffstat (limited to 'spec/unit/chef_fs')
-rw-r--r-- | spec/unit/chef_fs/file_system/cookbooks_dir_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/chef_fs/file_system/cookbooks_dir_spec.rb b/spec/unit/chef_fs/file_system/cookbooks_dir_spec.rb index 35a777a9e4..18ea740779 100644 --- a/spec/unit/chef_fs/file_system/cookbooks_dir_spec.rb +++ b/spec/unit/chef_fs/file_system/cookbooks_dir_spec.rb @@ -274,7 +274,11 @@ describe Chef::ChefFS::FileSystem::CookbooksDir do it 'all files can be read' do should_get_cookbook files.each do |path| - @rest.should_receive(:get_rest).with("cookbook_file:#{path}").once.and_return("This is #{path}'s content") + cookbook_file = double(path) + cookbook_file.should_receive(:open).with(no_args()).once + cookbook_file.should_receive(:read).with(no_args()).once.and_return("This is #{path}'s content") + cookbook_file.should_receive(:close!).with(no_args()).once + @rest.should_receive(:get_rest).with("cookbook_file:#{path}", true).once.and_return(cookbook_file) @rest.should_receive(:sign_on_redirect).with(no_args()).once.and_return(true) @rest.should_receive(:sign_on_redirect=).with(false).once @rest.should_receive(:sign_on_redirect=).with(true).once |