1
0
mirror of https://github.com/github/choosealicense.com synced 2024-11-05 19:28:50 +01:00

replace 'id' variables with 'spdx_lcase' to minimize confusion

This commit is contained in:
Mike Linksvayer 2016-06-01 08:36:56 -07:00
parent 49fca01280
commit b99e7ab017
2 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -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)