mirror of
https://github.com/github/choosealicense.com
synced 2024-12-23 21:30:41 +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|
|
||||
context "The #{license['title']} license" do
|
||||
let(:id) { license['spdx-lcase'] }
|
||||
let(:spdx_lcase) { license['spdx-lcase'] }
|
||||
let(:spdx_id) { license['spdx-id'] }
|
||||
|
||||
it 'has an SPDX ID' do
|
||||
@ -15,7 +15,7 @@ describe 'licenses' do
|
||||
end
|
||||
|
||||
it 'has an ID that is downcased SPDX ID' do
|
||||
expect(spdx_id.casecmp(id).zero?)
|
||||
expect(spdx_id.casecmp(spdx_lcase).zero?)
|
||||
end
|
||||
|
||||
it 'uses its SPDX name' do
|
||||
@ -26,7 +26,7 @@ describe 'licenses' do
|
||||
|
||||
context 'industry approval' 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
|
||||
|
||||
|
@ -34,16 +34,12 @@ end
|
||||
def licenses
|
||||
SpecHelper.licenses ||= begin
|
||||
site.collections['licenses'].docs.map do |license|
|
||||
id = File.basename(license.basename, '.txt')
|
||||
license.to_liquid.merge('spdx-lcase' => id)
|
||||
spdx_lcase = File.basename(license.basename, '.txt')
|
||||
license.to_liquid.merge('spdx-lcase' => spdx_lcase)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def license_ids
|
||||
licenses.map { |l| l['id'] }
|
||||
end
|
||||
|
||||
def site
|
||||
SpecHelper.site ||= begin
|
||||
site = Jekyll::Site.new(config)
|
||||
|
Loading…
x
Reference in New Issue
Block a user