summaryrefslogtreecommitdiff
path: root/spec/integration/java
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/java')
-rw-r--r--spec/integration/java/gradle_spec.rb6
-rw-r--r--spec/integration/java/maven_spec.rb42
2 files changed, 3 insertions, 45 deletions
diff --git a/spec/integration/java/gradle_spec.rb b/spec/integration/java/gradle_spec.rb
index 25d7e26..e6bda3c 100644
--- a/spec/integration/java/gradle_spec.rb
+++ b/spec/integration/java/gradle_spec.rb
@@ -122,10 +122,10 @@ plugins {
runner.add_file('.tool-versions', "gradle 1.9")
end
- it 'returns an empty report because the plugin we use does not work in this version of the gradle API' do
+ specify do
expect(subject).to match_schema
- expect(subject[:dependencies]).to be_empty
- expect(subject[:licenses]).to be_empty
+ expect(subject.dependency_names).to match_array(['postgresql'])
+ expect(subject.licenses_for('postgresql')).to match_array(['BSD-2-Clause'])
end
end
diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb
index 65d8bf5..217035d 100644
--- a/spec/integration/java/maven_spec.rb
+++ b/spec/integration/java/maven_spec.rb
@@ -114,48 +114,6 @@ RSpec.describe "maven" do
specify { expect(report.licenses_for('jackson-core')).to match_array(['Apache-2.0']) }
end
- context "when specifying the version of java using environment variables" do
- let(:output_file) { Pathname.new(runner.project_path.join('output.txt')) }
-
- before do
- runner.add_file('custom.sh') do
- <<~SCRIPT
- #!/bin/bash -l
-
- java -version &> '#{output_file}'
- SCRIPT
- end
- end
-
- it 'prioritizes `LM_JAVA_VERSION` over the `ASDF_JAVA_VERSION`' do
- runner.scan(env: {
- 'ASDF_JAVA_VERSION' => 'adopt-openjdk-11.0.7+10',
- 'LM_JAVA_VERSION' => '8',
- 'SETUP_CMD' => 'bash custom.sh'
- })
-
- expect(output_file).to exist
- expect(output_file.read).to include('openjdk version "1.8.0_252"')
- end
-
- it 'reads the ASDF_JAVA_VERSION' do
- runner.scan(env: {
- 'ASDF_JAVA_VERSION' => 'adopt-openjdk-11.0.7+10.1',
- 'SETUP_CMD' => 'bash custom.sh'
- })
-
- expect(output_file).to exist
- expect(output_file.read).to include('openjdk version "11.0.7"')
- end
-
- it 'defaults to java 8' do
- runner.scan(env: { 'SETUP_CMD' => 'bash custom.sh' })
-
- expect(output_file).to exist
- expect(output_file.read).to include('openjdk version "1.8.0_252"')
- end
- end
-
[
{ java: '8', maven: ['3.6.3', '3.5.4', '3.3.9', '3.2.5'] },
{ java: '11', maven: ['3.6.3', '3.5.4', '3.3.9', '3.2.5'] }