summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-10-21 13:31:40 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2021-10-21 13:31:40 -0700
commit3a3c2f601a0416e819a803762640f7c6ee869ac9 (patch)
tree4e2a7e95a4e096de666dd4b601e3477b46c675ad
parentefa3ab980f7bc12f1fbaaf830b6ebc8f2998e3f1 (diff)
downloadohai-3a3c2f601a0416e819a803762640f7c6ee869ac9.tar.gz
Fix windows hostname plugin specs
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/unit/plugins/hostname_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/unit/plugins/hostname_spec.rb b/spec/unit/plugins/hostname_spec.rb
index bf37ef1a..9c975fe7 100644
--- a/spec/unit/plugins/hostname_spec.rb
+++ b/spec/unit/plugins/hostname_spec.rb
@@ -142,7 +142,7 @@ describe Ohai::System, "hostname plugin for windows", :windows_only do
context "when hostname is not set for the machine" do
it "returns short machine name" do
- allow(Socket).to receive(:gethostbyaddr).with(anything).and_return(local_hostent)
+ expect(@plugin).to receive(:canonicalize_hostname).with(anything).and_return("local")
@plugin.run
expect(@plugin[:fqdn]).to eq("local")
end
@@ -150,7 +150,7 @@ describe Ohai::System, "hostname plugin for windows", :windows_only do
context "when hostname is set for the machine" do
it "returns the fqdn of the machine" do
- allow(Socket).to receive(:gethostbyaddr).with(anything).and_return(fqdn_hostent)
+ expect(@plugin).to receive(:canonicalize_hostname).with(anything).and_return("local.dx.internal.cloudapp.net")
@plugin.run
expect(@plugin[:fqdn]).to eq("local.dx.internal.cloudapp.net")
end