1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 12:50:24 +01:00
choosealicense.com/spec/license_rules_spec.rb

25 lines
563 B
Ruby
Raw Normal View History

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