summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/plugins/solaris2/platform_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/unit/plugins/solaris2/platform_spec.rb b/spec/unit/plugins/solaris2/platform_spec.rb
index ad0fc680..6fae7b95 100644
--- a/spec/unit/plugins/solaris2/platform_spec.rb
+++ b/spec/unit/plugins/solaris2/platform_spec.rb
@@ -65,4 +65,44 @@ UNAME_X
end
+ describe "on Solaris 11" do
+ before(:each) do
+ @uname_x = <<-UNAME_X
+System = SunOS
+Node = node.example.com
+Release = 5.11
+KernelID = 11.1
+Machine = i86pc
+BusType = <unknown>
+Serial = <unknown>
+Users = <unknown>
+OEM# = 0
+Origin# = 1
+NumCPU = 1
+UNAME_X
+
+ File.stub(:exists?).with("/sbin/uname").and_return(true)
+ @plugin.stub(:shell_out).with("/sbin/uname -X").and_return(mock_shell_out(0, @uname_x, ""))
+
+ @release = StringIO.new(" Oracle Solaris 11.1 X86\n")
+ File.stub(:open).with("/etc/release").and_yield(@release)
+ end
+
+ it "should run uname and set platform and build" do
+ @plugin.run
+ @plugin[:platform_build].should == "11.1"
+ end
+
+ it "should set the platform" do
+ @plugin.run
+ @plugin[:platform].should == "solaris2"
+ end
+
+ it "should set the platform_version" do
+ @plugin.run
+ @plugin[:platform_version].should == "5.11"
+ end
+
+ end
+
end