2017-06-23 06:26:23 +05:30
|
|
|
require "language/java"
|
|
|
|
|
|
|
|
describe Language::Java do
|
2017-06-25 06:27:53 +05:30
|
|
|
describe "::java_home_env" do
|
2017-06-23 06:26:23 +05:30
|
|
|
it "returns java_home path with version if version specified" do
|
|
|
|
java_home = described_class.java_home_env("blah")
|
2017-06-24 02:18:52 +05:30
|
|
|
expect(java_home[:JAVA_HOME]).to include("--version blah")
|
2017-06-23 06:26:23 +05:30
|
|
|
end
|
2017-06-24 02:18:52 +05:30
|
|
|
|
2017-06-23 06:26:23 +05:30
|
|
|
it "returns java_home path without version if version is not specified" do
|
|
|
|
java_home = described_class.java_home_env
|
2017-06-24 02:18:52 +05:30
|
|
|
expect(java_home[:JAVA_HOME]).not_to include("--version")
|
2017-06-23 06:26:23 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-06-25 06:27:53 +05:30
|
|
|
describe "::overridable_java_home_env" do
|
2017-06-23 06:26:23 +05:30
|
|
|
it "returns java_home path with version if version specified" do
|
|
|
|
java_home = described_class.overridable_java_home_env("blah")
|
2017-06-25 06:27:53 +05:30
|
|
|
expect(java_home[:JAVA_HOME]).to include("--version blah")
|
2017-06-23 06:26:23 +05:30
|
|
|
end
|
2017-06-24 02:18:52 +05:30
|
|
|
|
2017-06-23 06:26:23 +05:30
|
|
|
it "returns java_home path without version if version is not specified" do
|
|
|
|
java_home = described_class.overridable_java_home_env
|
2017-06-25 06:27:53 +05:30
|
|
|
expect(java_home[:JAVA_HOME]).not_to include("--version")
|
2017-06-23 06:26:23 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|