diff options
-rw-r--r-- | lib/rubygems/specification_record.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem.rb | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/rubygems/specification_record.rb b/lib/rubygems/specification_record.rb index d838fcea26..195a355496 100644 --- a/lib/rubygems/specification_record.rb +++ b/lib/rubygems/specification_record.rb @@ -30,7 +30,7 @@ module Gem # Returns the list of all specifications in the record def all - @all ||= Gem.loaded_specs.values + stubs.map(&:to_spec) + @all ||= stubs.map(&:to_spec) end ## diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 0d048b08b7..cdc3479e37 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1026,6 +1026,20 @@ class TestGem < Gem::TestCase Gem.refresh end + def test_activated_specs_does_not_cause_duplicates_when_looping_through_specs + util_make_gems + + s = Gem::Specification.first + s.activate + + Gem.refresh + + assert_equal 1, Gem::Specification.count {|spec| spec.full_name == s.full_name } + + Gem.loaded_specs.delete(s) + Gem.refresh + end + def test_self_ruby_escaping_spaces_in_path with_clean_path_to_ruby do with_rb_config_ruby("C:/Ruby 1.8/bin/ruby.exe") do |