[rubygems/rubygems] Test that two calls to stub_for
returns the same (cached) instance.
https://github.com/rubygems/rubygems/commit/00b3f55562
This commit is contained in:
parent
acc86570dd
commit
46462200af
Notes:
git
2020-05-08 14:14:08 +09:00
@ -1193,6 +1193,11 @@ dependencies: []
|
|||||||
assert_equal ['b-1'], Gem::Specification.stubs_for('b').map { |s| s.full_name }
|
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 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 'a'
|
||||||
Gem.loaded_specs.delete 'b'
|
Gem.loaded_specs.delete 'b'
|
||||||
Gem::Specification.class_variable_set(:@@stubs, nil)
|
Gem::Specification.class_variable_set(:@@stubs, nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user