mirror of
https://github.com/github/choosealicense.com
synced 2024-12-22 12:50:24 +01:00
make tests not overwrite non-mutable document 'id'
This commit is contained in:
parent
4551fddd88
commit
49fca01280
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||||||
describe 'license meta' do
|
describe 'license meta' do
|
||||||
licenses.each do |license|
|
licenses.each do |license|
|
||||||
# Manually load the raw license so we don't get the defaults
|
# 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
|
context "The #{license['title']} license" do
|
||||||
it 'should only contain supported meta fields' do
|
it 'should only contain supported meta fields' do
|
||||||
|
@ -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['id'] }
|
let(:id) { 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
|
||||||
|
@ -35,7 +35,7 @@ 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')
|
id = File.basename(license.basename, '.txt')
|
||||||
license.to_liquid.merge('id' => id)
|
license.to_liquid.merge('spdx-lcase' => id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user