diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-07-19 12:37:05 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-07-19 12:37:05 -0700 |
commit | dc5aa2759006f7cdb58bd085d64e3a6051b3158e (patch) | |
tree | af0bc24e8e4e51169593c4e62fdb105b102674d9 /spec/support | |
parent | 99c7bbf32fb3dbc1d9e80370a68b256b7e939e0d (diff) | |
download | chef-dc5aa2759006f7cdb58bd085d64e3a6051b3158e.tar.gz |
replace glibc resolver with ruby resolver
also wires up file providers to reload /etc/reoslv.conf when it changes.
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared/unit/provider/file.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb index cb539ffbc3..0959406583 100644 --- a/spec/support/shared/unit/provider/file.rb +++ b/spec/support/shared/unit/provider/file.rb @@ -683,6 +683,24 @@ shared_examples_for Chef::Provider::File do end end + context "do_resolv_conf_fixup" do + %w{/resolv.conf /etc/resolv.con /etc/foo/resolv.conf /c/resolv.conf}.each do |path| + context "when managing #{path}" do + let(:resource_path) { path } + it "does not reload the nameservers" do + expect(Resolv::DefaultResolver).not_to receive(:replace_resolvers) + provider.send(:do_resolv_conf_fixup) + end + end + end + context "when managing /etc/resolv.conf" do + let(:resource_path) { "/etc/resolv.conf" } + it "reloads the nameservers" do + expect(Resolv::DefaultResolver).to receive(:replace_resolvers) + provider.send(:do_resolv_conf_fixup) + end + end + end end context "action delete" do |