summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-04-28 12:23:27 -0700
committerTim Smith <tsmith@chef.io>2017-05-12 09:29:33 -0700
commit94413e636c12f68f283f0284312a059fb943da31 (patch)
treed7c99c2955f624152abbe1bed7772a5cacd13009
parent874a530a917a4abd8fb1876309d7f2895f0ff461 (diff)
downloadchef-94413e636c12f68f283f0284312a059fb943da31.tar.gz
Check the content of the preference file
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/provider/apt_preference_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/unit/provider/apt_preference_spec.rb b/spec/unit/provider/apt_preference_spec.rb
index 4ea33cd5a8..4711d11f70 100644
--- a/spec/unit/provider/apt_preference_spec.rb
+++ b/spec/unit/provider/apt_preference_spec.rb
@@ -56,7 +56,8 @@ describe Chef::Provider::AptPreference do
it "creates a sanitized .pref file" do
provider.run_action(:add)
expect(new_resource).to be_updated_by_last_action
- expect(File.exist?(::File.join(pref_dir,'libmysqlclient16_1wildcard.pref'))).to be true
+ expect(File.read(::File.join(pref_dir,'libmysqlclient16_1wildcard.pref'))).to match(/Package: libmysqlclient16.1*.*Pin: 1.0.1.*Pin-Priority: 1001/m)
+
end
end
end