diff --git a/spec/license_meta_spec.rb b/spec/license_meta_spec.rb index 8b5e583..0933085 100644 --- a/spec/license_meta_spec.rb +++ b/spec/license_meta_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'license meta' do licenses.each do |license| # Manually load the raw license so we don't get the defaults - raw_fields = SafeYAML.load_file("_licenses/#{license['id']}.txt") + raw_fields = SafeYAML.load_file("_licenses/#{license['spdx-lcase']}.txt") context "The #{license['title']} license" do it 'should only contain supported meta fields' do diff --git a/spec/license_spec.rb b/spec/license_spec.rb index 2a9ae68..2917392 100644 --- a/spec/license_spec.rb +++ b/spec/license_spec.rb @@ -7,7 +7,7 @@ describe 'licenses' do licenses.each do |license| context "The #{license['title']} license" do - let(:id) { license['id'] } + 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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8c33f3c..adec337 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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('id' => 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)