summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/java/pom-public-gitlab-repository.xml5
-rw-r--r--spec/integration/java/maven_spec.rb6
-rw-r--r--spec/unit/license/management/repository_spec.rb18
3 files changed, 26 insertions, 3 deletions
diff --git a/spec/fixtures/java/pom-public-gitlab-repository.xml b/spec/fixtures/java/pom-public-gitlab-repository.xml
index c39e703..11abf7f 100644
--- a/spec/fixtures/java/pom-public-gitlab-repository.xml
+++ b/spec/fixtures/java/pom-public-gitlab-repository.xml
@@ -12,5 +12,10 @@
<artifactId>example</artifactId>
<version>1.0</version>
</dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.3.0</version>
+ </dependency>
</dependencies>
</project>
diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb
index 9230a9f..410d607 100644
--- a/spec/integration/java/maven_spec.rb
+++ b/spec/integration/java/maven_spec.rb
@@ -13,8 +13,9 @@ RSpec.describe "maven" do
})
expect(report).to match_schema
- expect(report.dependency_names).to match_array(['example'])
+ expect(report.dependency_names).to match_array(%w[example jaxb-api])
expect(report.licenses_for('example')).to match_array(['MIT'])
+ expect(report.licenses_for('jaxb-api')).to match_array(['GPL-2.0-only', 'cddl 1.1'])
end
it 'downloads packages from by using a custom `settings.xml`' do
@@ -27,7 +28,8 @@ RSpec.describe "maven" do
})
expect(report).to match_schema
- expect(report[:dependencies]).to match_array([{ name: 'example', url: '', description: '', paths: ['.'], licenses: ['MIT'] }])
+ expect(report[:dependencies]).to match_array([{ name: 'example', url: '', description: '', paths: ['.'], licenses: ['MIT'] },
+ { description: '', licenses: ['GPL-2.0-only', 'cddl 1.1'], name: 'jaxb-api', paths: ['.'], url: '' }])
end
end
diff --git a/spec/unit/license/management/repository_spec.rb b/spec/unit/license/management/repository_spec.rb
index 6006e8a..5fa37e9 100644
--- a/spec/unit/license/management/repository_spec.rb
+++ b/spec/unit/license/management/repository_spec.rb
@@ -32,7 +32,23 @@ RSpec.describe License::Management::Repository do
end
[
- ['Apache License v2.0', 'Apache-2.0']
+ ['Apache License v2.0', 'Apache-2.0'],
+ ['COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0', 'CDDL-1.0'],
+ ['Common Development and Distribution License 1.1', 'CDDL-1.1'],
+ ['Apache Software License - Version 2.0', 'Apache-2.0'],
+ ['ASF 2.0', 'Apache-2.0'],
+ ['Eclipse Public License - v 1.0', 'EPL-1.0'],
+ ['Eclipse Public License 1.0', 'EPL-1.0'],
+ ['Eclipse Public License v1.0', 'EPL-1.0'],
+ ['GNU General Public License v2.0 only, with Classpath exception', 'GPL-2.0-only'],
+ ['GNU General Public License, version 2', 'GPL-2.0-only'],
+ ['GNU Lesser General Public License v2.1 or later', 'LGPL-2.1-or-later'],
+ ['GNU Library General Public License v2.1 or later', 'LGPL-2.1+'],
+ ['GPL-2.0', 'GPL-2.0-only'],
+ ['LGPL-2.1', 'LGPL-2.1'],
+ ['GPL2 w/ CPE', 'GPL-2.0-only'],
+ ['BSD 3-Clause License', 'BSD-3-Clause'],
+ ['The BSD 3-Clause License', 'BSD-3-Clause']
].each do |short_name, spdx_id|
context "when mapping a `#{short_name}` license" do
let(:license) { LicenseFinder::License.new(short_name: short_name, matcher: LicenseFinder::License::NoneMatcher.new, url: nil) }