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

27 lines
565 B
Ruby
Raw Normal View History

2015-08-22 21:42:12 +02:00
require 'spec_helper'
2016-01-20 16:20:04 +01:00
describe "license rules" do
licenses.each do |license|
2015-08-22 21:42:12 +02:00
2016-01-20 16:20:04 +01:00
groups = rules.keys
2015-08-22 21:42:12 +02:00
2016-01-20 16:20:04 +01:00
context "The #{license["title"]} license" do
groups.each do |group|
2015-08-22 21:42:12 +02:00
2016-01-20 16:20:04 +01:00
valid_tags = rules[group].map { |r| r["tag"] }
2015-08-22 21:42:12 +02:00
2016-01-20 16:20:04 +01:00
context "the #{group} group" do
it "should exist" do
expect(license[group]).to_not be_nil
end
2015-08-22 21:42:12 +02:00
2016-01-20 16:20:04 +01:00
it "should only contain valid tags" do
extra = license[group] - valid_tags
expect(extra).to be_empty
end
2015-08-22 21:42:12 +02:00
end
end
end
end
end