diff options
| author | mo khan <mo.khan@gmail.com> | 2020-08-21 19:07:16 +0000 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-08-21 19:07:16 +0000 |
| commit | eb11eeb1018c4d32e8dbaf3f734e588205f0671f (patch) | |
| tree | e0595b6d9b1ad9f85969b1c304613420e777b993 | |
| parent | 366fbf58b1334f771e76b313dac58f568a420e0e (diff) | |
| parent | 50a62393fe6ba477deb224480a2133482238754e (diff) | |
Merge branch '207904-bsd-not-precise' into 'master'v3.24.0
Denormalize BSD-4-Clause license
See merge request gitlab-org/security-products/license-management!196
22 files changed, 141 insertions, 101 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 70cae4a..62ad140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # GitLab License management changelog +## v3.24.0 + +- Removes `BSD-4-Clause` from a list of normalized licenses. (!196) + ## v3.23.0 - Upgrade [LicenseFinder](https://github.com/pivotal/LicenseFinder/) to `6.8.1` (!209) @@ -45,7 +45,7 @@ You can run the tests from inside a docker container: $ ./bin/docker-build $ ./bin/docker-shell $ ./bin/setup -$ ./bin/test +$ ./bin/test [path to file] ``` If you need to debug any specific issues you can do this from within the docker container by diff --git a/lib/license/management/repository.rb b/lib/license/management/repository.rb index 4b6e8a5..3d16b78 100644 --- a/lib/license/management/repository.rb +++ b/lib/license/management/repository.rb @@ -64,7 +64,7 @@ module License { 'id' => name.downcase, 'name' => name, - 'url' => present?(license.url) ? license.url : '' + 'url' => normalized_url(license.url) } end @@ -90,6 +90,13 @@ module License logger.error(e) nil end + + def normalized_url(url) + return '' unless present?(url) + return 'http://en.wikipedia.org/wiki/BSD_licenses' if url.match?('BSD_licenses#4-clause_license') + + url + end end end end diff --git a/normalized-licenses.yml b/normalized-licenses.yml index 46c7d26..2961e06 100644 --- a/normalized-licenses.yml +++ b/normalized-licenses.yml @@ -10,9 +10,7 @@ ids: ASL, version 2: Apache-2.0 BSD 3-Clause: BSD-3-Clause BSD (3 clause): BSD-3-Clause - BSD: BSD-4-Clause BSD-derived (http://www.repoze.org/LICENSE.txt): BSD-2-Clause - BSD-like: BSD-4-Clause BSD style: BSD-3-Clause CC0 1.0 Universal: CC0-1.0 CC01: CC0-1.0 diff --git a/spec/fixtures/expected/java/gradle/v2.0.json b/spec/fixtures/expected/java/gradle/v2.0.json index 4caca99..8592aaa 100644 --- a/spec/fixtures/expected/java/gradle/v2.0.json +++ b/spec/fixtures/expected/java/gradle/v2.0.json @@ -20,9 +20,9 @@ "count": 2 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 1 }, { @@ -47,7 +47,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/gradle/v2.1.json b/spec/fixtures/expected/java/gradle/v2.1.json index b639938..4b3dff5 100644 --- a/spec/fixtures/expected/java/gradle/v2.1.json +++ b/spec/fixtures/expected/java/gradle/v2.1.json @@ -7,11 +7,6 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - { "id": "LGPL-2.1", "name": "GNU Lesser General Public License v2.1 only", "url": "https://opensource.org/licenses/LGPL-2.1" @@ -27,6 +22,11 @@ "url": "https://opensource.org/licenses/MPL-2.0" }, { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, + { "id": "cddl + gplv2 with classpath exception", "name": "CDDL + GPLv2 with classpath exception", "url": "" @@ -39,7 +39,7 @@ "package_manager": "gradle", "path": "build.gradle", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven-multimodules/v2.0.json b/spec/fixtures/expected/java/maven-multimodules/v2.0.json index 594c36e..4440793 100644 --- a/spec/fixtures/expected/java/maven-multimodules/v2.0.json +++ b/spec/fixtures/expected/java/maven-multimodules/v2.0.json @@ -8,9 +8,9 @@ "count": 16 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 4 }, { @@ -41,7 +41,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -52,7 +52,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -63,7 +63,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -252,7 +252,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven-multimodules/v2.1.json b/spec/fixtures/expected/java/maven-multimodules/v2.1.json index 492f36c..a2336bc 100644 --- a/spec/fixtures/expected/java/maven-multimodules/v2.1.json +++ b/spec/fixtures/expected/java/maven-multimodules/v2.1.json @@ -7,11 +7,6 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - { "id": "LGPL-2.1", "name": "GNU Lesser General Public License v2.1 only", "url": "https://opensource.org/licenses/LGPL-2.1" @@ -22,6 +17,11 @@ "url": "https://opensource.org/licenses/MPL-1.1" }, { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, + { "id": "unknown", "name": "unknown", "url": "" @@ -34,7 +34,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -43,7 +43,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -52,7 +52,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -207,7 +207,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven/v2.0.json b/spec/fixtures/expected/java/maven/v2.0.json index 4b4a06c..8840ee1 100644 --- a/spec/fixtures/expected/java/maven/v2.0.json +++ b/spec/fixtures/expected/java/maven/v2.0.json @@ -20,9 +20,9 @@ "count": 2 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 1 }, { @@ -47,7 +47,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/java/maven/v2.1.json b/spec/fixtures/expected/java/maven/v2.1.json index a02947a..fea817f 100644 --- a/spec/fixtures/expected/java/maven/v2.1.json +++ b/spec/fixtures/expected/java/maven/v2.1.json @@ -7,11 +7,6 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - { "id": "LGPL-2.1", "name": "GNU Lesser General Public License v2.1 only", "url": "https://opensource.org/licenses/LGPL-2.1" @@ -27,6 +22,11 @@ "url": "https://opensource.org/licenses/MPL-2.0" }, { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, + { "id": "cddl + gplv2 with classpath exception", "name": "CDDL + GPLv2 with classpath exception", "url": "" @@ -39,7 +39,7 @@ "package_manager": "maven", "path": "pom.xml", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/2/pip/v2.0.json b/spec/fixtures/expected/python/2/pip/v2.0.json index 8ed6ee7..5515387 100644 --- a/spec/fixtures/expected/python/2/pip/v2.0.json +++ b/spec/fixtures/expected/python/2/pip/v2.0.json @@ -2,9 +2,9 @@ "version": "2.0", "licenses": [ { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 4 }, { @@ -47,7 +47,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -80,7 +80,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -91,7 +91,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -113,7 +113,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/2/pip/v2.1.json b/spec/fixtures/expected/python/2/pip/v2.1.json index 3203679..05492d6 100644 --- a/spec/fixtures/expected/python/2/pip/v2.1.json +++ b/spec/fixtures/expected/python/2/pip/v2.1.json @@ -7,11 +7,6 @@ "url": "https://opensource.org/licenses/BSD-3-Clause" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - { "id": "MIT", "name": "MIT License", "url": "https://opensource.org/licenses/MIT" @@ -27,6 +22,11 @@ "url": "https://opensource.org/licenses/Python-2.0" }, { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, + { "id": "copyright (c) 2015, julien fache", "name": "Copyright (c) 2015, Julien Fache", "url": "" @@ -39,7 +39,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -66,7 +66,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -75,7 +75,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -93,7 +93,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/3/pip/v2.0.json b/spec/fixtures/expected/python/3/pip/v2.0.json index b5c23ae..49c7328 100644 --- a/spec/fixtures/expected/python/3/pip/v2.0.json +++ b/spec/fixtures/expected/python/3/pip/v2.0.json @@ -2,9 +2,9 @@ "version": "2.0", "licenses": [ { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 4 }, { @@ -53,7 +53,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -86,7 +86,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -97,7 +97,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -119,7 +119,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/3/pip/v2.1.json b/spec/fixtures/expected/python/3/pip/v2.1.json index 787b800..a23b401 100644 --- a/spec/fixtures/expected/python/3/pip/v2.1.json +++ b/spec/fixtures/expected/python/3/pip/v2.1.json @@ -12,11 +12,6 @@ "url": "https://opensource.org/licenses/BSD-3-Clause" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - { "id": "MIT", "name": "MIT License", "url": "https://opensource.org/licenses/MIT" @@ -32,6 +27,11 @@ "url": "https://opensource.org/licenses/Python-2.0" }, { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, + { "id": "copyright (c) 2015, julien fache", "name": "Copyright (c) 2015, Julien Fache", "url": "" @@ -44,7 +44,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -71,7 +71,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -80,7 +80,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { @@ -98,7 +98,7 @@ "package_manager": "pip", "path": "requirements.txt", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/pipenv/v2.0.json b/spec/fixtures/expected/python/pipenv/v2.0.json index ba4d529..59913c2 100644 --- a/spec/fixtures/expected/python/pipenv/v2.0.json +++ b/spec/fixtures/expected/python/pipenv/v2.0.json @@ -8,9 +8,9 @@ "count": 1 }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause", + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses", "count": 1 }, { @@ -35,7 +35,7 @@ "." ], "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/fixtures/expected/python/pipenv/v2.1.json b/spec/fixtures/expected/python/pipenv/v2.1.json index 30161e1..9e64c02 100644 --- a/spec/fixtures/expected/python/pipenv/v2.1.json +++ b/spec/fixtures/expected/python/pipenv/v2.1.json @@ -7,16 +7,16 @@ "url": "https://opensource.org/licenses/Apache-2.0" }, { - "id": "BSD-4-Clause", - "name": "BSD 4-Clause \"Original\" or \"Old\" License", - "url": "http://directory.fsf.org/wiki/License:BSD_4Clause" - }, - { "id": "MIT", "name": "MIT License", "url": "https://opensource.org/licenses/MIT" }, { + "id": "bsd", + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses" + }, + { "id": "public domain, python, 2-clause bsd, gpl 3 (see copying.txt)", "name": "public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt)", "url": "" @@ -29,7 +29,7 @@ "package_manager": "pip", "path": "Pipfile.lock", "licenses": [ - "BSD-4-Clause" + "bsd" ] }, { diff --git a/spec/integration/c/conan_spec.rb b/spec/integration/c/conan_spec.rb index 52b7a39..baae361 100644 --- a/spec/integration/c/conan_spec.rb +++ b/spec/integration/c/conan_spec.rb @@ -16,7 +16,7 @@ RSpec.describe "conan" do specify { expect(subject).to match_schema } specify { expect { subject }.to perform_under(60).sec.warmup(0).times } - specify { expect(subject.dependency_names).to match_array(%w[openssl poco]) } + specify { expect(subject.dependency_names).to match_array(%w[bzip2 expat openssl pcre poco sqlite3 zlib]) } specify { expect(subject.licenses_for('openssl')).to match_array(['OpenSSL']) } specify { expect(subject.licenses_for('poco')).to match_array(['BSL-1.0']) } end diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb index c9a7026..65d8bf5 100644 --- a/spec/integration/java/maven_spec.rb +++ b/spec/integration/java/maven_spec.rb @@ -71,8 +71,8 @@ RSpec.describe "maven" do expect(subject[:dependencies]).not_to be_empty [ - { name: "asm", licenses: ["BSD-4-Clause"] }, - { name: "asm-commons", licenses: ["BSD-4-Clause"] }, + { name: "asm", licenses: ["bsd"] }, + { name: "asm-commons", licenses: ["bsd"] }, { name: "jackson-annotations", licenses: ["Apache-2.0"] }, { name: "jackson-core", licenses: ["Apache-2.0"] }, { name: "jackson-databind", licenses: ["Apache-2.0"] }, @@ -81,7 +81,7 @@ RSpec.describe "maven" do { name: "log4j-api", licenses: ["Apache-2.0"] }, { name: "log4j-core", licenses: ["Apache-2.0"] }, { name: "netty-all", licenses: ["Apache-2.0"] }, - { name: "stax2-api", licenses: ["BSD-4-Clause"] } + { name: "stax2-api", licenses: ["bsd"] } ].each do |dependency| expect(subject.licenses_for(dependency[:name])).to match_array(dependency[:licenses]) end diff --git a/spec/integration/js/npm_spec.rb b/spec/integration/js/npm_spec.rb index 8ab5be6..1481748 100644 --- a/spec/integration/js/npm_spec.rb +++ b/spec/integration/js/npm_spec.rb @@ -95,7 +95,7 @@ RSpec.describe "npm" do ["isstream", "0.1.2", ["MIT"]], ["jsbn", "0.1.1", ["MIT"]], ["jsdom", "15.2.1", ["MIT"]], - ["json-schema", "0.2.3", ["AFL-2.1", "BSD-4-Clause"]], + ["json-schema", "0.2.3", ["AFL-2.1", "bsd"]], ["json-schema-traverse", "0.4.1", ["MIT"]], ["json-stringify-safe", "5.0.1", ["ISC"]], ["jsonfile", "4.0.0", ["MIT"]], @@ -242,7 +242,7 @@ RSpec.describe "npm" do ["isstream", "0.1.2", ["MIT"]], ["jsbn", "0.1.1", ["MIT"]], ["jsdom", "15.2.1", ["MIT"]], - ["json-schema", "0.2.3", ["AFL-2.1", "BSD-4-Clause"]], + ["json-schema", "0.2.3", ["AFL-2.1", "bsd"]], ["json-schema-traverse", "0.4.1", ["MIT"]], ["json-stringify-safe", "5.0.1", ["ISC"]], ["jsonfile", "4.0.0", ["MIT"]], @@ -397,7 +397,7 @@ RSpec.describe "npm" do ["isstream", "0.1.2", ["MIT"]], ["jsbn", "0.1.1", ["MIT"]], ["jsdom", "15.2.1", ["MIT"]], - ["json-schema", "0.2.3", ["AFL-2.1", "BSD-4-Clause"]], + ["json-schema", "0.2.3", ["AFL-2.1", "bsd"]], ["json-schema-traverse", "0.4.1", ["MIT"]], ["json-stringify-safe", "5.0.1", ["ISC"]], ["jsonfile", "4.0.0", ["MIT"]], diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index 9c2721d..9911dc5 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "pip" do expect(report).to match_schema expect(report[:version]).to start_with('2') expect(report.dependency_names).to include("sentry-sdk") - expect(report.licenses_for('sentry-sdk')).to match_array(["BSD-4-Clause"]) + expect(report.licenses_for('sentry-sdk')).to match_array(["bsd"]) end end @@ -46,6 +46,22 @@ RSpec.describe "pip" do end end + context 'with BSD licenses dependencies' do + let(:requirements) { %w[webencodings idna click EasyProcess PyVirtualDisplay].join("\n") } + + it 'finds proper versions of BSD license' do + runner.add_file('requirements.txt', requirements) + + report = runner.scan + + expect(report.licenses_for('webencodings')).to eq(['bsd']) + expect(report.licenses_for('idna')).to eq(['bsd-like']) + expect(report.licenses_for('EasyProcess')).to eq(['bsd']) + expect(report.licenses_for('PyVirtualDisplay')).to eq(['bsd']) + expect(report.licenses_for('click')).to eq(['BSD-3-Clause']) + end + end + [{ version: '2', commit: '04dce91b' }, { version: '3', commit: '48e250a1' }].each do |python| ['1.0', '1.1', '2.0', '2.1'].each do |report_version| context "when generating a `#{report_version}` report using Python `#{python[:version]}`" do @@ -148,14 +164,14 @@ RSpec.describe "pip" do runner.add_file('setup.py') do <<~RAW -from setuptools import setup, find_packages - -setup( - name='gitlab-sp-test-python-pip', - version='1.2.0', - packages=find_packages(), - install_requires=['requests'], -) + from setuptools import setup, find_packages + + setup( + name='gitlab-sp-test-python-pip', + version='1.2.0', + packages=find_packages(), + install_requires=['requests'], + ) RAW end end @@ -178,9 +194,9 @@ setup( before do runner.add_file('custom.sh') do <<~SCRIPT - #!/bin/bash -l + #!/bin/bash -l - python --version &> '#{output_file}' + python --version &> '#{output_file}' SCRIPT end end diff --git a/spec/unit/license/management/report/v2_spec.rb b/spec/unit/license/management/report/v2_spec.rb index 1bcdb16..a7c0d18 100644 --- a/spec/unit/license/management/report/v2_spec.rb +++ b/spec/unit/license/management/report/v2_spec.rb @@ -7,7 +7,6 @@ RSpec.describe License::Management::Report::V2 do 'AGPL-3.0' => 'AGPL-3.0', 'Apache 2.0' => 'Apache-2.0', 'Artistic-2.0' => 'Artistic-2.0', - 'BSD' => 'BSD-4-Clause', 'CC0 1.0 Universal' => 'CC0-1.0', 'CDDL-1.0' => 'CDDL-1.0', 'CDDL-1.1' => 'CDDL-1.1', diff --git a/spec/unit/license/management/repository_spec.rb b/spec/unit/license/management/repository_spec.rb index 04eb469..c54af77 100644 --- a/spec/unit/license/management/repository_spec.rb +++ b/spec/unit/license/management/repository_spec.rb @@ -60,5 +60,21 @@ RSpec.describe License::Management::Repository do it { expect(subject.item_for(license)['id']).to eql(spdx_id) } end end + + context 'with BSD license' do + subject(:item_license) { described_class.new.item_for(license) } + + let(:license) do + LicenseFinder::License.new( + short_name: 'BSD', + other_names: ['BSD4', 'bsd-old', '4-clause BSD', 'BSD-4-Clause', 'BSD 4-Clause', 'BSD License'], + url: 'http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29' + ) + end + + it 'returns general url' do + expect(item_license['url']).to eq('http://en.wikipedia.org/wiki/BSD_licenses') + end + end end end |
