diff options
author | Tim Smith <tsmith@chef.io> | 2017-04-05 08:21:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 08:21:06 -0700 |
commit | 710b7f56e9d26c9062d51fc7f273b81a4e18fb11 (patch) | |
tree | 270cb6ad2df4208d9bf94c704c8bacf9256e7a31 /spec | |
parent | d456abf400268d3087f2c6aa711b967d70dd9ff3 (diff) | |
parent | a4680511a4ffc6d7c3d723bc796a3b7b5c915522 (diff) | |
download | ohai-710b7f56e9d26c9062d51fc7f273b81a4e18fb11.tar.gz |
Merge pull request #982 from chef/sbt_fix
Remove sbt version detect as it's not possible in the current sbt
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/scala_spec.rb | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/spec/unit/plugins/scala_spec.rb b/spec/unit/plugins/scala_spec.rb index c8f8c3eb..18e8de69 100644 --- a/spec/unit/plugins/scala_spec.rb +++ b/spec/unit/plugins/scala_spec.rb @@ -26,15 +26,11 @@ describe Ohai::System, "plugin scala" do end let(:scala_out) { "Scala code runner version 2.11.6 -- Copyright 2002-2013, LAMP/EPFL" } - let(:sbt_out) { "sbt launcher version 0.13.8" } def setup_plugin allow(plugin).to receive(:shell_out) .with("scala -version") .and_return(mock_shell_out(0, "", scala_out)) - allow(plugin).to receive(:shell_out) - .with("sbt --version", { :timeout => 5 }) - .and_return(mock_shell_out(0, sbt_out, "")) end context "if scala is installed" do @@ -48,45 +44,15 @@ describe Ohai::System, "plugin scala" do end end - context "if sbt is installed" do - - before(:each) do - setup_plugin - plugin.run - end - - it "sets languages[:scala][:sbt][:version]" do - expect(plugin[:languages][:scala][:sbt][:version]).to eql("0.13.8") - end - end - - context "if scala/sbt are not installed" do - + context "if scala is not installed" do before(:each) do allow(plugin).to receive(:shell_out) .and_raise( Ohai::Exceptions::Exec ) plugin.run end - it "does NOT set the languages[:scala] if scala/sbts commands fails" do + it "does NOT set the languages[:scala] if scala commands fails" do expect(plugin[:languages]).not_to have_key(:scala) end end - - context "if sbt is not installed" do - before(:each) do - allow(plugin).to receive(:shell_out) - .with("scala -version") - .and_return(mock_shell_out(0, "", scala_out)) - - allow(plugin).to receive(:shell_out) - .with("sbt --version", { :timeout => 5 }) - .and_raise( Ohai::Exceptions::Exec ) - plugin.run - end - - it "does NOT set the languages[:scala][:sbt] if sbt command fails" do - expect(plugin[:languages][:scala]).not_to have_key(:sbt) - end - end end |