diff options
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 |