1
0
mirror of https://github.com/github/choosealicense.com synced 2024-07-03 08:59:12 +02:00
choosealicense.com/spec/license_spec.rb

31 lines
707 B
Ruby
Raw Normal View History

2015-03-07 18:47:24 +01:00
require 'spec_helper'
2016-01-20 16:20:04 +01:00
describe "licenses" do
2016-01-20 16:37:44 +01:00
2016-01-20 16:20:04 +01:00
licenses.each do |license|
2016-01-15 23:40:32 +01:00
2016-01-20 16:20:04 +01:00
# "No license" isn't really a license, so no need to test
next if license["id"] == "no-license"
2016-01-15 23:40:32 +01:00
2016-01-20 16:20:04 +01:00
context "The #{license["title"]} license" do
2016-01-15 23:40:32 +01:00
2016-01-20 16:20:04 +01:00
let(:id) { license["id"] }
2016-01-15 23:40:32 +01:00
2016-01-20 16:20:04 +01:00
it "has an SPDX ID" do
expect(spdx_ids).to include(id)
end
2016-01-15 23:40:32 +01:00
2016-01-20 16:20:04 +01:00
it "uses its SPDX name" do
spdx = find_spdx(id)
expect(spdx[1]["name"].gsub(/ only$/,"")).to eql(license["title"])
end
2016-01-15 23:40:32 +01:00
2016-01-20 16:20:04 +01:00
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."
end
2016-01-16 00:01:07 +01:00
end
2015-03-07 19:38:52 +01:00
end
2015-03-07 18:47:24 +01:00
end
end