diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/darwin/hostname_spec.rb | 9 | ||||
-rw-r--r-- | spec/unit/plugins/freebsd/hostname_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/linux/hostname_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/netbsd/hostname_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/plugins/openbsd/hostname_spec.rb | 5 |
5 files changed, 8 insertions, 15 deletions
diff --git a/spec/unit/plugins/darwin/hostname_spec.rb b/spec/unit/plugins/darwin/hostname_spec.rb index 831781a3..e16c758a 100644 --- a/spec/unit/plugins/darwin/hostname_spec.rb +++ b/spec/unit/plugins/darwin/hostname_spec.rb @@ -22,14 +22,13 @@ describe Ohai::System, "Darwin hostname plugin" do before do @plugin = get_plugin("hostname") allow(@plugin).to receive(:collect_os).and_return(:darwin) - allow(@plugin).to receive(:shell_out).with("hostname -s").and_return(mock_shell_out(0, "katie", "")) - allow(@plugin).to receive(:shell_out).with("hostname").and_return(mock_shell_out(0, "katie.local", "")) + allow(@plugin).to receive(:shell_out).with("scutil --get HostName").and_return(mock_shell_out(0, "katie", "")) + allow(@plugin).to receive(:shell_out).with("scutil --get ComputerName").and_return(mock_shell_out(0, "katie.local", "")) allow(@plugin).to receive(:resolve_fqdn).and_return("katie.bethell") end - it_should_check_from("darwin::hostname", "hostname", "hostname -s", "katie") - - it_should_check_from("linux::hostname", "machinename", "hostname", "katie.local") + it_should_check_from("darwin::hostname", "hostname", "scutil --get HostName", "katie") + it_should_check_from("darwin::hostname", "machinename", "scutil --get ComputerName", "katie.local") it "uses #resolve_fqdn to find the fqdn" do @plugin.run diff --git a/spec/unit/plugins/freebsd/hostname_spec.rb b/spec/unit/plugins/freebsd/hostname_spec.rb index 025ccbf9..9211c3c8 100644 --- a/spec/unit/plugins/freebsd/hostname_spec.rb +++ b/spec/unit/plugins/freebsd/hostname_spec.rb @@ -28,8 +28,6 @@ describe Ohai::System, "FreeBSD hostname plugin" do end it_should_check_from("freebsd::hostname", "hostname", "hostname -s", "katie") - it_should_check_from("freebsd::hostname", "fqdn", "hostname -f", "katie.bethell") - it_should_check_from("freebsd::hostname", "machinename", "hostname", "katie.local") end diff --git a/spec/unit/plugins/linux/hostname_spec.rb b/spec/unit/plugins/linux/hostname_spec.rb index 9bc6e86d..1700e289 100644 --- a/spec/unit/plugins/linux/hostname_spec.rb +++ b/spec/unit/plugins/linux/hostname_spec.rb @@ -28,9 +28,7 @@ describe Ohai::System, "Linux hostname plugin" do end it_should_check_from("linux::hostname", "hostname", "hostname -s", "katie") - it_should_check_from("linux::hostname", "fqdn", "hostname --fqdn", "katie.bethell") - it_should_check_from("linux::hostname", "machinename", "hostname", "katie.local") describe "when domain name is unset" do diff --git a/spec/unit/plugins/netbsd/hostname_spec.rb b/spec/unit/plugins/netbsd/hostname_spec.rb index 0a960d1a..6f09f433 100644 --- a/spec/unit/plugins/netbsd/hostname_spec.rb +++ b/spec/unit/plugins/netbsd/hostname_spec.rb @@ -27,9 +27,8 @@ describe Ohai::System, "NetBSD hostname plugin" do allow(@plugin).to receive(:resolve_fqdn).and_return("katie.bethell") end - it_should_check_from("linux::hostname", "hostname", "hostname -s", "katie") - - it_should_check_from("linux::hostname", "machinename", "hostname", "katie.local") + it_should_check_from("netbsd::hostname", "hostname", "hostname -s", "katie") + it_should_check_from("netbsd::hostname", "machinename", "hostname", "katie.local") it "uses #resolve_fqdn to find the fqdn" do @plugin.run diff --git a/spec/unit/plugins/openbsd/hostname_spec.rb b/spec/unit/plugins/openbsd/hostname_spec.rb index 0ed89787..18767b7a 100644 --- a/spec/unit/plugins/openbsd/hostname_spec.rb +++ b/spec/unit/plugins/openbsd/hostname_spec.rb @@ -27,9 +27,8 @@ describe Ohai::System, "OpenBSD hostname plugin" do allow(@plugin).to receive(:resolve_fqdn).and_return("katie.bethell") end - it_should_check_from("linux::hostname", "hostname", "hostname -s", "katie") - - it_should_check_from("linux::hostname", "machinename", "hostname", "katie.local") + it_should_check_from("openbsd::hostname", "hostname", "hostname -s", "katie") + it_should_check_from("openbsd::hostname", "machinename", "hostname", "katie.local") it "uses #resolve_fqdn to find the fqdn" do @plugin.run |