summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKC Braunschweig <kcbraunschweig@gmail.com>2014-02-05 19:14:27 +0000
committeradamedx <adamed@opscode.com>2014-03-31 09:47:16 -0700
commit9b0688a35b58989b7274448401d6e63cfba2ee29 (patch)
treed2ccf46f0641c4cee250c5ca343e59922698b2b3
parent1c2f1a82a629d7e37b087bd4a4a359eea615a310 (diff)
downloadohai-9b0688a35b58989b7274448401d6e63cfba2ee29.tar.gz
Updated tests for new command
-rw-r--r--spec/unit/plugins/java_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/plugins/java_spec.rb b/spec/unit/plugins/java_spec.rb
index 13f29996..6d722222 100644
--- a/spec/unit/plugins/java_spec.rb
+++ b/spec/unit/plugins/java_spec.rb
@@ -28,11 +28,11 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
shared_examples_for "when the JRE is installed" do
before do
@stderr = "java version \"1.5.0_16\"\nJava(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)\nJava HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx16m -version").and_return(mock_shell_out(0, "", @stderr))
end
- it "should run java -version" do
- @plugin.should_receive(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ it "should run java -mx16m -version" do
+ @plugin.should_receive(:shell_out).with("java -mx16m -version").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
end
@@ -63,7 +63,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
it "should not set the languages[:java] tree up if java command fails" do
@stderr = "Some error output here"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(1, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx16m -version").and_return(mock_shell_out(1, "", @stderr))
@plugin.run
@plugin[:languages].should_not have_key(:java)
end
@@ -73,11 +73,11 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
before(:each) do
@stderr = "java version \"1.6.0_22\"\nJava(TM) 2 Runtime Environment (build 1.6.0_22-b04)\nJava HotSpot(TM) Server VM (build 17.1-b03, mixed mode)"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx16m -version").and_return(mock_shell_out(0, "", @stderr))
end
- it "should run java -version" do
- @plugin.should_receive(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ it "should run java -mx16m -version" do
+ @plugin.should_receive(:shell_out).with("java -mx16m -version").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
end
@@ -108,7 +108,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
it "should not set the languages[:java] tree up if java command fails" do
@stderr = "Some error output here"
- @plugin.stub(:shell_out).with("java -version").and_return(mock_shell_out(0, "", @stderr))
+ @plugin.stub(:shell_out).with("java -mx16m -version").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
@plugin[:languages].should_not have_key(:java)
end
@@ -159,7 +159,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
end
it "does not attempt to get java info" do
- @plugin.should_not_receive(:shell_out).with("java -version")
+ @plugin.should_not_receive(:shell_out).with("java -mx16m -version")
@plugin.run
@plugin[:languages].should_not have_key(:java)
end