summaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_source_index.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 20:57:02 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 20:57:02 +0000
commit76417b6bddde585667ee739d01264dd8d15fa491 (patch)
tree6f55131cbd153845e71dadc91f08636aa6707423 /test/rubygems/test_gem_source_index.rb
parent9599fa2877ae7d09157d5ea4d33b1894a2486c7c (diff)
downloadruby-76417b6bddde585667ee739d01264dd8d15fa491.tar.gz
ruby-76417b6bddde585667ee739d01264dd8d15fa491.tar.xz
ruby-76417b6bddde585667ee739d01264dd8d15fa491.zip
Update to RubyGems 1.1.1 r1701.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_source_index.rb')
-rw-r--r--test/rubygems/test_gem_source_index.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_source_index.rb b/test/rubygems/test_gem_source_index.rb
index 74aa91d63..140f3ad06 100644
--- a/test/rubygems/test_gem_source_index.rb
+++ b/test/rubygems/test_gem_source_index.rb
@@ -395,13 +395,31 @@ class TestGemSourceIndex < RubyGemTestCase
assert_equal [updated_platform.name], @source_index.outdated
end
+ def test_refresh_bang
+ a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec"
+
+ FileUtils.mv a1_spec, @tempdir
+
+ source_index = Gem::SourceIndex.from_installed_gems
+
+ assert !source_index.gems.include?(@a1.full_name)
+
+ FileUtils.mv File.join(@tempdir, "#{@a1.full_name}.gemspec"), a1_spec
+
+ source_index.refresh!
+
+ assert source_index.gems.include?(@a1.full_name)
+ end
+
def test_remove_extra
@source_index.add_spec @a1
@source_index.add_spec @a2
+ @source_index.add_spec @pl1
- @source_index.remove_extra [@a1.full_name]
+ @source_index.remove_extra [@a1.full_name, @pl1.full_name]
- assert_equal [@a1.full_name], @source_index.gems.map { |n,s| n }
+ assert_equal [@a1.full_name],
+ @source_index.gems.map { |n,s| n }.sort
end
def test_remove_extra_no_changes