aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_specification.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-08-01 09:56:39 +0200
committergit <svn-admin@ruby-lang.org>2022-08-03 06:56:18 +0900
commit20936eb3a95f3564e565f59228a35453ae94eee3 (patch)
tree77b5764ec94ec8e6597e365219b61c250f38bcf5 /test/rubygems/test_gem_specification.rb
parenteaf6189fe59ac4839d3a04bf7f9552fc22f09471 (diff)
downloadruby-20936eb3a95f3564e565f59228a35453ae94eee3.tar.gz
[rubygems/rubygems] Warn (rather than crash) when setting `nil` specification versions
https://github.com/rubygems/rubygems/commit/a4ba1a4d97
Diffstat (limited to 'test/rubygems/test_gem_specification.rb')
-rw-r--r--test/rubygems/test_gem_specification.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index 6117e81a81..cf0dba4331 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -1220,6 +1220,15 @@ dependencies: []
assert_equal "1.0.0.dev", spec.version.to_s
end
+ def test_initialize_nil_version
+ expected = "nil versions are discouraged and will be deprecated in Rubygems 4\n"
+ actual_stdout, actual_stderr = capture_output do
+ Gem::Specification.new.version = nil
+ end
+ assert_empty actual_stdout
+ assert_equal(expected, actual_stderr)
+ end
+
def test__dump
@a2.platform = Gem::Platform.local
@a2.instance_variable_set :@original_platform, "old_platform"