mirror of
https://github.com/github/choosealicense.com
synced 2024-11-06 03:38:49 +01:00
replace 'id' variables with 'spdx_lcase' to minimize confusion
This commit is contained in:
parent
49fca01280
commit
b99e7ab017
@ -7,7 +7,7 @@ describe 'licenses' do
|
|||||||
|
|
||||||
licenses.each do |license|
|
licenses.each do |license|
|
||||||
context "The #{license['title']} license" do
|
context "The #{license['title']} license" do
|
||||||
let(:id) { license['spdx-lcase'] }
|
let(:spdx_lcase) { license['spdx-lcase'] }
|
||||||
let(:spdx_id) { license['spdx-id'] }
|
let(:spdx_id) { license['spdx-id'] }
|
||||||
|
|
||||||
it 'has an SPDX ID' do
|
it 'has an SPDX ID' do
|
||||||
@ -15,7 +15,7 @@ describe 'licenses' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'has an ID that is downcased SPDX ID' do
|
it 'has an ID that is downcased SPDX ID' do
|
||||||
expect(spdx_id.casecmp(id).zero?)
|
expect(spdx_id.casecmp(spdx_lcase).zero?)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'uses its SPDX name' do
|
it 'uses its SPDX name' do
|
||||||
@ -26,7 +26,7 @@ describe 'licenses' do
|
|||||||
|
|
||||||
context 'industry approval' do
|
context 'industry approval' do
|
||||||
it 'should be approved by OSI or FSF or OD' do
|
it 'should be approved by OSI or FSF or OD' do
|
||||||
expect(approved_licenses).to include(id), 'See https://git.io/vzCTV.'
|
expect(approved_licenses).to include(spdx_lcase), 'See https://git.io/vzCTV.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,16 +34,12 @@ end
|
|||||||
def licenses
|
def licenses
|
||||||
SpecHelper.licenses ||= begin
|
SpecHelper.licenses ||= begin
|
||||||
site.collections['licenses'].docs.map do |license|
|
site.collections['licenses'].docs.map do |license|
|
||||||
id = File.basename(license.basename, '.txt')
|
spdx_lcase = File.basename(license.basename, '.txt')
|
||||||
license.to_liquid.merge('spdx-lcase' => id)
|
license.to_liquid.merge('spdx-lcase' => spdx_lcase)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def license_ids
|
|
||||||
licenses.map { |l| l['id'] }
|
|
||||||
end
|
|
||||||
|
|
||||||
def site
|
def site
|
||||||
SpecHelper.site ||= begin
|
SpecHelper.site ||= begin
|
||||||
site = Jekyll::Site.new(config)
|
site = Jekyll::Site.new(config)
|
||||||
|
Loading…
Reference in New Issue
Block a user