summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosef Šimánek <josef.simanek@gmail.com>2023-08-30 02:31:09 +0200
committergit <svn-admin@ruby-lang.org>2023-09-30 11:20:08 +0000
commit4cf68908e59979306d6069b1828c209079bcb9b7 (patch)
tree7c4a4f5304a538a5be46428ced4fef7e53bd9b29 /test
parentd647709d1acc7d56a3e89b5166c816d65fdb606d (diff)
[rubygems/rubygems] Update SPDX list and warn on deprecated identifiers.
https://github.com/rubygems/rubygems/commit/61667028f5
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb6
-rw-r--r--test/rubygems/test_gem_specification.rb51
2 files changed, 38 insertions, 19 deletions
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb
index 42715df8ea..983cf7b472 100644
--- a/test/rubygems/test_gem_commands_build_command.rb
+++ b/test/rubygems/test_gem_commands_build_command.rb
@@ -26,7 +26,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end
@gem = util_spec "some_gem" do |s|
- s.license = "AGPL-3.0"
+ s.license = "AGPL-3.0-only"
s.files = ["README.md"]
end
@@ -198,8 +198,8 @@ class TestGemCommandsBuildCommand < Gem::TestCase
end
error = @ui.error.split "\n"
- assert_equal "WARNING: licenses is empty, but is recommended. Use a license identifier from", error.shift
- assert_equal "http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,", error.shift
+ assert_equal "WARNING: licenses is empty, but is recommended. Use an license identifier from", error.shift
+ assert_equal "https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,", error.shift
assert_equal "or set it to nil if you don't want to specify a license.", error.shift
assert_equal "WARNING: See https://guides.rubygems.org/specification-reference/ for help", error.shift
assert_equal [], error
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 6657d77b07..8d86820c71 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -3104,8 +3104,8 @@ Please report a bug if this causes problems.
end
assert_match <<-WARNING, @ui.error
-WARNING: licenses is empty, but is recommended. Use a license identifier from
-http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+WARNING: licenses is empty, but is recommended. Use an license identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
or set it to nil if you don't want to specify a license.
WARNING
end
@@ -3156,8 +3156,8 @@ or set it to nil if you don't want to specify a license.
end
assert_match <<-WARNING, @ui.error
-WARNING: license value 'BSD' is invalid. Use a license identifier from
-http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+WARNING: License identifier 'BSD' is invalid. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
or set it to nil if you don't want to specify a license.
WARNING
end
@@ -3173,7 +3173,7 @@ or set it to nil if you don't want to specify a license.
assert_empty @ui.error
end
- def test_validate_license_values_plus
+ def test_validate_deprecated_license_values_plus
util_setup_validate
use_ui @ui do
@@ -3181,7 +3181,11 @@ or set it to nil if you don't want to specify a license.
@a1.validate
end
- assert_empty @ui.error
+ assert_match <<-WARNING, @ui.error
+WARNING: License identifier 'GPL-2.0+' is deprecated. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+or set it to nil if you don't want to specify a license.
+ WARNING
end
def test_validate_license_values_or_later
@@ -3199,7 +3203,7 @@ or set it to nil if you don't want to specify a license.
util_setup_validate
use_ui @ui do
- @a1.licenses = ["GPL-2.0+ WITH Autoconf-exception-2.0"]
+ @a1.licenses = ["GPL-2.0-or-later WITH Autoconf-exception-2.0"]
@a1.validate
end
@@ -3215,13 +3219,13 @@ or set it to nil if you don't want to specify a license.
end
assert_match <<-WARNING, @ui.error
-WARNING: license value 'GPL-2.0+ FOO' is invalid. Use a license identifier from
-http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+WARNING: License identifier 'GPL-2.0+ FOO' is invalid. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
or set it to nil if you don't want to specify a license.
WARNING
assert_match <<-WARNING, @ui.error
-WARNING: license value 'GPL-2.0 FOO' is invalid. Use a license identifier from
-http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+WARNING: License identifier 'GPL-2.0+ FOO' is invalid. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
or set it to nil if you don't want to specify a license.
WARNING
end
@@ -3230,13 +3234,28 @@ or set it to nil if you don't want to specify a license.
util_setup_validate
use_ui @ui do
- @a1.licenses = ["GPL-2.0+ WITH Autocofn-exception-2.0"]
+ @a1.licenses = ["GPL-2.0-only WITH Autocofn-exception-2.0"]
+ @a1.validate
+ end
+
+ assert_match <<-WARNING, @ui.error
+WARNING: License identifier 'GPL-2.0-only WITH Autocofn-exception-2.0' is invalid. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+or set it to nil if you don't want to specify a license.
+ WARNING
+ end
+
+ def test_validate_license_with_deprecated_exception
+ util_setup_validate
+
+ use_ui @ui do
+ @a1.licenses = ["GPL-2.0-only WITH Nokia-Qt-exception-1.1"]
@a1.validate
end
assert_match <<-WARNING, @ui.error
-WARNING: license value 'GPL-2.0+ WITH Autocofn-exception-2.0' is invalid. Use a license identifier from
-http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+WARNING: Exception identifier at 'GPL-2.0-only WITH Nokia-Qt-exception-1.1' is deprecated. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
or set it to nil if you don't want to specify a license.
WARNING
end
@@ -3250,8 +3269,8 @@ or set it to nil if you don't want to specify a license.
end
assert_match <<-WARNING, @ui.error
-WARNING: license value 'ruby' is invalid. Use a license identifier from
-http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
+WARNING: License identifier 'ruby' is invalid. Use an identifier from
+https://spdx.org/licenses or 'Nonstandard' for a nonstandard license,
or set it to nil if you don't want to specify a license.
Did you mean 'Ruby'?
WARNING