diff options
| author | mo khan <mo.khan@gmail.com> | 2020-02-26 14:35:49 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-02-26 14:35:49 -0700 |
| commit | f945654789655429566414c91b4d00dcd658cabc (patch) | |
| tree | 9efa10bcdb24cd532644a5705d7f9f74aa2d74b0 | |
| parent | 2e61e862b24918fb341154a4ad53eb7424d7976d (diff) | |
Add specs to test each version of gradle
| -rw-r--r-- | Dockerfile | 5 | ||||
| -rw-r--r-- | spec/integration/java/gradle_spec.rb | 53 |
2 files changed, 26 insertions, 32 deletions
@@ -23,13 +23,16 @@ RUN add-apt-repository ppa:ondrej/php -y && apt-get update -y && \ echo 'conan' >> $HOME/.default-python-packages && \ echo '\n. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc && \ echo 'legacy_version_file = yes' > $HOME/.asdfrc && \ + asdf plugin-add gradle && \ asdf plugin-add java && \ asdf plugin-add python && \ + echo 'gradle system' >> $HOME/.tool-versions && \ echo 'java adopt-openjdk-8u242-b08 adopt-openjdk-11.0.6+10' >> $HOME/.tool-versions && \ echo 'python 3.8.1 3.5.9 2.7.17' >> $HOME/.tool-versions && \ asdf install && \ - asdf global python 3.8.1 && \ + asdf global gradle system && \ asdf global java adopt-openjdk-8u242-b08 && \ + asdf global python 3.8.1 && \ asdf reshim && \ bash -lc "gem install --no-document 'bundler:~> 1.7' 'bundler:~> 2.0'" && \ rm -fr /opt/jdk* && \ diff --git a/spec/integration/java/gradle_spec.rb b/spec/integration/java/gradle_spec.rb index 6823ce1..7b3b4bf 100644 --- a/spec/integration/java/gradle_spec.rb +++ b/spec/integration/java/gradle_spec.rb @@ -48,9 +48,17 @@ plugins { end end - context 'when scanning a gradle project that uses kotlin' do - let(:build_file_content) do - <<~GRADLE + [ + '6.2', + '5.6', + '4.9', + '3.5', + '2.9', + '1.9', + ].each do |version| + context "when scanning a gradle (v#{version}) project that uses a kotlin build script" do + let(:build_file_content) do + <<~KOTLIN plugins { `java-library` } @@ -62,36 +70,19 @@ dependencies { implementation("com.google.guava:guava:28.1-jre") testImplementation("junit:junit:4.12") } - GRADLE - end - let(:settings_file_content) { 'rootProject.name = "example"' } - - it 'scans a gradle project' do - runner.add_file('build.gradle.kts', build_file_content) - runner.add_file('settings.gradle.kts', settings_file_content) - - report = runner.scan - expect(report).to match_schema(version: '2.0') - expect(report[:licenses]).to be_empty - expect(report[:dependencies]).to be_empty - end - end + KOTLIN + end - context "when scanning a v6 gradle project" do - it 'scans a gradle project' do - content = <<~GRADLE - GRADLE - runner.add_file('build.gradle', content) + it 'scans a gradle project' do + runner.add_file('build.gradle.kts', build_file_content) + runner.add_file('settings.gradle.kts', 'rootProject.name = "example"') + runner.add_file('.tool-versions', "gradle #{version}") - report = runner.scan - expect(report).to match_schema(version: '2.0') - expect(report[:licenses]).to be_empty - expect(report[:dependencies]).to be_empty + report = runner.scan + expect(report).to match_schema(version: '2.0') + expect(report[:licenses]).to be_empty + expect(report[:dependencies]).to be_empty + end end end - context "when scanning a v5 gradle project" - context "when scanning a v4 gradle project" - context "when scanning a v3 gradle project" - context "when scanning a v2 gradle project" - context "when scanning a v1 gradle project" end |
