From 49fca012805c457f3da856ec3bf01a33ebd4209e Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Tue, 31 May 2016 15:44:12 -0700 Subject: [PATCH] make tests not overwrite non-mutable document 'id' --- spec/license_meta_spec.rb | 2 +- spec/license_spec.rb | 2 +- spec/spec_helper.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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..1515fdb 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(:id) { license['spdx-lcase'] } let(:spdx_id) { license['spdx-id'] } it 'has an SPDX ID' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8c33f3c..cf1460f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,7 +35,7 @@ def licenses SpecHelper.licenses ||= begin site.collections['licenses'].docs.map do |license| id = File.basename(license.basename, '.txt') - license.to_liquid.merge('id' => id) + license.to_liquid.merge('spdx-lcase' => id) end end end