diff options
author | Thom May <thom@chef.io> | 2017-04-25 11:17:53 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2017-04-25 11:17:53 +0100 |
commit | e31b32ac7f8a6eddde22cd0fd915e7302447bdb3 (patch) | |
tree | da8bb7453bb4bb621de884943649b00eb44e1591 /spec/unit/cookbook | |
parent | c7aa5baef1621b5ccd8dd240befe71e34b84f931 (diff) | |
download | chef-e31b32ac7f8a6eddde22cd0fd915e7302447bdb3.tar.gz |
lazily load cookbook_files and templatestm/even_lazier
Fixes: #6051
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'spec/unit/cookbook')
-rw-r--r-- | spec/unit/cookbook/synchronizer_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index 77e64482da..6578a9e670 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -118,6 +118,7 @@ describe Chef::CookbookSynchronizer do let(:synchronizer) do Chef::Config[:no_lazy_load] = no_lazy_load + Chef::Config[:file_cache_path] = "/file-cache" Chef::CookbookSynchronizer.new(cookbook_manifest, events) end @@ -292,7 +293,7 @@ describe Chef::CookbookSynchronizer do # Current file has fff000, want abc123 expect(Chef::CookbookVersion).to receive(:checksum_cookbook_file). with("/file-cache/cookbooks/cookbook_a/recipes/default.rb"). - and_return("fff000") + and_return("fff000").at_least(:once) # Fetch and copy default.rb attribute file expect(server_api).to receive(:streaming_request). @@ -308,7 +309,7 @@ describe Chef::CookbookSynchronizer do # Current file has fff000, want abc456 expect(Chef::CookbookVersion).to receive(:checksum_cookbook_file). with("/file-cache/cookbooks/cookbook_a/attributes/default.rb"). - and_return("fff000") + and_return("fff000").at_least(:once) end def setup_no_lazy_files_and_templates_chksum_mismatch_expectations @@ -365,12 +366,12 @@ describe Chef::CookbookSynchronizer do # Current file has abc123, want abc123 expect(Chef::CookbookVersion).to receive(:checksum_cookbook_file). with("/file-cache/cookbooks/cookbook_a/recipes/default.rb"). - and_return("abc123") + and_return("abc123").at_least(:once) # Current file has abc456, want abc456 expect(Chef::CookbookVersion).to receive(:checksum_cookbook_file). with("/file-cache/cookbooks/cookbook_a/attributes/default.rb"). - and_return("abc456") + and_return("abc456").at_least(:once) # :load called twice expect(file_cache).to receive(:load). |