diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-04-30 12:29:20 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-05-01 11:09:49 -0700 |
commit | f4b7c395a59c9093c90d8f9219522d5940845bb6 (patch) | |
tree | 426635a5f8079b4121f9597c8b8e7c4b60738088 /spec/support | |
parent | 92824ed4962d4dfa713a31e2395210781c167b86 (diff) | |
download | chef-f4b7c395a59c9093c90d8f9219522d5940845bb6.tar.gz |
test state_for_resource_reporter on file resource
and fix it to hit the right key.
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared/unit/provider/file.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb index 7e0213b316..c62bb420ba 100644 --- a/spec/support/shared/unit/provider/file.rb +++ b/spec/support/shared/unit/provider/file.rb @@ -532,7 +532,7 @@ shared_examples_for Chef::Provider::File do expect(provider).to receive(:checksum).with(tempfile_path).and_return(tempfile_sha256) allow(provider).to receive(:managing_content?).and_return(true) allow(provider).to receive(:checksum).with(resource_path).and_return(tempfile_sha256) - expect(resource).not_to receive(:checksum) # do not mutate the new resource + expect(resource).not_to receive(:checksum).with(tempfile_sha256) # do not mutate the new resource expect(provider.deployment_strategy).to receive(:deploy).with(tempfile_path, normalized_path) end context "when the file was created" do @@ -541,6 +541,7 @@ shared_examples_for Chef::Provider::File do expect(provider).not_to receive(:do_backup) provider.send(:do_contents_changes) expect(resource.diff).to be_nil + expect(resource.state_for_resource_reporter[:checksum]).to eql(tempfile_sha256) end end context "when the file was not created" do @@ -549,6 +550,7 @@ shared_examples_for Chef::Provider::File do expect(provider).to receive(:do_backup) provider.send(:do_contents_changes) expect(resource.diff).to eq(diff_for_reporting) + expect(resource.state_for_resource_reporter[:checksum]).to eql(tempfile_sha256) end end end |