From c9e43804d6723bddc01f5d914e6c328eac5cd03f Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Wed, 26 Aug 2015 09:26:04 -0400 Subject: [PATCH 1/2] add some help text to license test --- test/test_grammars.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 65a7e6de..82086db9 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -83,12 +83,16 @@ class TestGrammars < Minitest::Test def test_submodules_have_recognized_licenses unrecognized = submodule_licenses.select { |k,v| v.nil? && Licensee::Project.new(k).license_file } unrecognized.reject! { |k,v| PROJECT_WHITELIST.include?(k) } - assert_equal Hash.new, unrecognized, "The following submodules have unrecognized licenses:\n* #{unrecognized.keys.join("\n* ")}" + message = "The following submodules have unrecognized licenses:\n* #{unrecognized.keys.join("\n* ")}\n" + message << "Please ensure that the project's LICENSE file contains the full text of the license." + assert_equal Hash.new, unrecognized, message end def test_submodules_have_licenses unlicensed = submodule_licenses.select { |k,v| v.nil? }.reject { |k,v| PROJECT_WHITELIST.include?(k) } - assert_equal Hash.new, unlicensed, "The following submodules don't have licenses:\n* #{unlicensed.keys.join("\n* ")}" + message = "The following submodules don't have licenses:\n* #{unlicensed.keys.join("\n* ")}\n" + message << "Please ensure that the project has a LICENSE file, and that the LICENSE file contains the full text of the license." + assert_equal Hash.new, unlicensed, message end def test_submodules_have_approved_licenses From 7c3e2650333f3d2ac10a48f8d41262281782e588 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Wed, 26 Aug 2015 12:31:29 -0400 Subject: [PATCH 2/2] also add help for unapproved licenses --- test/test_grammars.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 82086db9..569da5c9 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -97,7 +97,9 @@ class TestGrammars < Minitest::Test def test_submodules_have_approved_licenses unapproved = submodule_licenses.reject { |k,v| LICENSE_WHITELIST.include?(v) || PROJECT_WHITELIST.include?(k) }.map { |k,v| "#{k}: #{v}"} - assert_equal [], unapproved, "The following submodules have unapproved licenses:\n* #{unapproved.join("\n* ")}" + message = "The following submodules have unapproved licenses:\n* #{unapproved.join("\n* ")}\n" + message << "The license must be added to the LICENSE_WHITELIST in /test/test_grammars.rb once approved." + assert_equal [], unapproved, message end def test_submodules_whitelist_has_no_extra_entries