diff options
Diffstat (limited to 'spec/unit/plugins/solaris2/hostname_spec.rb')
-rw-r--r-- | spec/unit/plugins/solaris2/hostname_spec.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/unit/plugins/solaris2/hostname_spec.rb b/spec/unit/plugins/solaris2/hostname_spec.rb index 390b5e45..a455bd2c 100644 --- a/spec/unit/plugins/solaris2/hostname_spec.rb +++ b/spec/unit/plugins/solaris2/hostname_spec.rb @@ -19,19 +19,20 @@ require "spec_helper" describe Ohai::System, "Solaris2.X hostname plugin" do + let(:plugin) { get_plugin("hostname") } + before do - @plugin = get_plugin("hostname") - allow(@plugin).to receive(:collect_os).and_return(:solaris2) - allow(@plugin).to receive(:resolve_fqdn).and_return("kitteh.inurfridge.eatinurfoodz") - allow(@plugin).to receive(:shell_out).with("hostname").and_return(mock_shell_out(0, "kitteh\n", "")) - # Socket.stub(:getaddrinfo).and_return( [["AF_INET", 0, "kitteh.inurfridge.eatinurfoodz", "10.1.2.3", 2, 0, 0]] ); + allow(plugin).to receive(:collect_os).and_return(:solaris2) + allow(plugin).to receive(:resolve_fqdn).and_return("kitteh.inurfridge.eatinurfoodz") + allow(plugin).to receive(:shell_out).with("hostname").and_return(mock_shell_out(0, "kitteh\n", "")) + # Socket.stub(:getaddrinfo).and_return( [["AF_INET", 0, "kitteh.inurfridge.eatinurfoodz", "10.1.2.3", 2, 0, 0]] ); end it_should_check_from("solaris2::hostname", "hostname", "hostname", "kitteh") it "gets the fqdn value from #resolve_fqdn" do - @plugin.run - expect(@plugin["fqdn"]).to eq("kitteh.inurfridge.eatinurfoodz") + plugin.run + expect(plugin["fqdn"]).to eq("kitteh.inurfridge.eatinurfoodz") end end |