1
0
mirror of https://github.com/github/choosealicense.com synced 2024-11-06 03:38:49 +01:00
choosealicense.com/spec/license_rules_spec.rb

27 lines
594 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-03-27 02:19:44 +02:00
2015-08-22 21:42:12 +02:00
require 'spec_helper'
2016-02-08 21:37:19 +01:00
describe 'license rules' do
2016-01-20 16:20:04 +01:00
licenses.each do |license|
groups = rules.keys
2015-08-22 21:42:12 +02:00
2016-02-08 21:37:19 +01:00
context "The #{license['title']} license" do
2016-01-20 16:20:04 +01:00
groups.each do |group|
2016-02-08 21:37:19 +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
2016-02-08 21:37:19 +01:00
it 'should exist' do
2016-01-20 16:20:04 +01:00
expect(license[group]).to_not be_nil
end
2015-08-22 21:42:12 +02:00
2016-02-08 21:37:19 +01:00
it 'should only contain valid tags' do
2016-01-20 16:20:04 +01:00
extra = license[group] - valid_tags
expect(extra).to be_empty
end
2015-08-22 21:42:12 +02:00
end
end
end
end
end