aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_specification.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-19 06:16:19 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-19 06:16:19 +0000
commit5f6715275e703ab49666a0440e6fcbb92a24c32f (patch)
treea998b4d6bf4f1dd3ef2b84adef8971eb78643ae2 /test/rubygems/test_gem_specification.rb
parent9c065a4bfb96d9d482b54e7831e26d01ace77b0d (diff)
downloadruby-5f6715275e703ab49666a0440e6fcbb92a24c32f.tar.gz
* lib/rubygems: Update to RubyGems 2.5.0+ HEAD(c6b4946).
this version includes #1114, #1314, #1322, #1375, #1383, #1387 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_specification.rb')
-rw-r--r--test/rubygems/test_gem_specification.rb61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 60f603361a..1ca2046195 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -2128,6 +2128,27 @@ dependencies: []
assert_nil @ext.to_fullpath("notexist")
end
+ def test_fullpath_return_rb_extension_file_when_exist_the_same_name_file
+ ext_spec
+
+ @ext.require_paths = 'lib'
+
+ dir = File.join(@gemhome, 'gems', @ext.original_name, 'lib')
+ expected_rb = File.join(dir, 'code.rb')
+ FileUtils.mkdir_p dir
+ FileUtils.touch expected_rb
+
+ dir = @ext.extension_dir
+ ext = RbConfig::CONFIG["DLEXT"]
+ expected_so = File.join(dir, "code.#{ext}")
+ FileUtils.mkdir_p dir
+ FileUtils.touch expected_so
+
+ @ext.activate
+
+ assert_equal expected_rb, @ext.to_fullpath("code")
+ end
+
def test_require_already_activated
save_loaded_features do
a1 = new_spec "a", "1", nil, "lib/d.rb"
@@ -2874,6 +2895,46 @@ http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
warning
end
+ def test_validate_license_values_plus
+ util_setup_validate
+
+ use_ui @ui do
+ @a1.licenses = ['GPL-2.0+']
+ @a1.validate
+ end
+
+ assert_empty @ui.error
+ end
+
+ def test_validate_license_values_with
+ util_setup_validate
+
+ use_ui @ui do
+ @a1.licenses = ['GPL-2.0+ WITH Autoconf-exception-2.0']
+ @a1.validate
+ end
+
+ assert_empty @ui.error
+ end
+
+ def test_validate_license_with_nonsense_suffix
+ util_setup_validate
+
+ use_ui @ui do
+ @a1.licenses = ['GPL-2.0+ FOO', 'GPL-2.0 FOO']
+ @a1.validate
+ 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
+ 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
+ end
+
def test_validate_name
util_setup_validate