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-29 18:44:28 +01:00
|
|
|
it "matches the number of files in the _licenses folder" do
|
2016-02-03 01:02:01 +01:00
|
|
|
expect(licenses.count).to eql(Dir["#{licenses_path}/*.html"].count)
|
2016-01-29 18:44:28 +01:00
|
|
|
end
|
|
|
|
|
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
|
|
|
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)
|
2016-01-20 16:42:36 +01:00
|
|
|
expect(spdx).to_not be_nil
|
2016-01-20 16:20:04 +01:00
|
|
|
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
|
2016-02-08 19:25:06 +01:00
|
|
|
|
|
|
|
context "minimum permissions" do
|
|
|
|
permissions = license["permitted"]
|
|
|
|
it "should allow commercial use" do
|
|
|
|
expect(permissions).to include("commercial-use")
|
|
|
|
end
|
|
|
|
it "should allow modification" do
|
|
|
|
expect(permissions).to include("modifications")
|
|
|
|
end
|
|
|
|
it "should allow distribution" do
|
|
|
|
expect(permissions).to include("distribution")
|
|
|
|
end
|
|
|
|
it "should allow private use" do
|
|
|
|
expect(permissions).to include("private-use")
|
|
|
|
end
|
|
|
|
end
|
2015-03-07 19:38:52 +01:00
|
|
|
end
|
2015-03-07 18:47:24 +01:00
|
|
|
end
|
|
|
|
end
|