From 9b0688a35b58989b7274448401d6e63cfba2ee29 Mon Sep 17 00:00:00 2001 From: KC Braunschweig Date: Wed, 5 Feb 2014 19:14:27 +0000 Subject: Updated tests for new command --- spec/unit/plugins/java_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'spec/unit/plugins/java_spec.rb') 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 -- cgit v1.2.1