diff options
author | Vít Ondruch <vondruch@redhat.com> | 2019-08-27 13:16:27 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:13:29 +0900 |
commit | 46462200afef55fd21b72ad1ff745739b085a793 (patch) | |
tree | 484ed444b859cb9bc1c93ee6c7efa4eeff6bd05f /test | |
parent | acc86570dd8cc1920d1c55da7836d6c60d98a6d5 (diff) |
[rubygems/rubygems] Test that two calls to `stub_for` returns the same (cached) instance.
https://github.com/rubygems/rubygems/commit/00b3f55562
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index f6caba896a..afcdc0dab3 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -1193,6 +1193,11 @@ dependencies: [] assert_equal ['b-1'], Gem::Specification.stubs_for('b').map { |s| s.full_name } assert_equal 2, Gem::Specification.class_variable_get(:@@stubs_by_name).length + assert_equal( + Gem::Specification.stubs_for('a').map { |s| s.object_id }, + Gem::Specification.stubs_for('a').map { |s| s.object_id } + ) + Gem.loaded_specs.delete 'a' Gem.loaded_specs.delete 'b' Gem::Specification.class_variable_set(:@@stubs, nil) |