Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove RG stubs, fix shadowed test.

  • Loading branch information...
commit a686213893f6f85c98d435e9ad76f4f72a227a02 1 parent 1e69165
@jbarnette authored
View
55 lib/rubygems.rb
@@ -1,55 +0,0 @@
-# Some stubs to keep from having to do the real 'require
-# "rubygems"'. It comes with too much cruft. Many other RG files don't
-# do well with this. This does a really good job of showing what
-# methods should be moved off of the Gem module too.
-
-module Gem
- VERSION = "1.3.7" unless defined? ::Gem::VERSION # tons
- ConfigMap = {} unless defined? ::Gem::ConfigMap # tons
- RubyGemsVersion = VERSION unless defined? ::Gem::RubyGemsVersion # jruby
- UserInteraction = Module.new # security
-
- def self.binary_mode # installer
- "rb"
- end
-
- def self.configuration # builder
- require "ostruct"
- OpenStruct.new
- end
-
- def self.dir # installer
- nil
- end
-
- def self.ensure_gem_subdirectories _ # installer
- end
-
- def self.post_install_hooks # installer
- []
- end
-
- def self.pre_install_hooks # installer
- []
- end
-
- def self.ruby_version # installer
- Gem::Version.new "42"
- end
-
- def self.source_index # installer
- nil
- end
-
- def self.suffix_pattern
- @suffix_pattern ||= "{#{suffixes.join(',')}}"
- end
-
- def self.suffixes # activation, require
- ['', '.rb', '.rbw', '.so', '.bundle', '.dll', '.sl', '.jar']
- end
-
- def self.user_home # security
- ENV["HOME"]
- end
-end
View
4 lib/rubygems/future/test.rb
@@ -14,7 +14,9 @@ module Gem; end
end
end
-require "rubygems" # fake
+require "rubygems"
+
+Gem::DefaultUserInteraction.ui = Gem::SilentUI.new
require "fileutils"
require "minitest/autorun"
View
35 test/test_gem_repo.rb
@@ -125,8 +125,18 @@ def test_gems
gem "foo", "2.0.0"
gem "bar"
- assert_equal %w(bar foo), r.gems.latest.map { |m| m.name }.sort
- assert_kind_of Gem::Info, r.gems.first
+ assert_equal %w(bar-1.0.0 foo-1.0.0 foo-2.0.0),
+ r.gems.map { |g| g.id }.sort
+ end
+ end
+
+ def test_gems_secondary_path
+ repo do |extra|
+ bar = gem "bar"
+
+ repo extra.home do |r|
+ assert_equal [bar], r.gems.wrapped
+ end
end
end
@@ -222,27 +232,6 @@ def test_specdir
end
end
- def test_gems
- repo do |r|
- gem "foo"
- gem "foo", "2.0.0"
- gem "bar"
-
- assert_equal %w(bar-1.0.0 foo-1.0.0 foo-2.0.0),
- r.gems.map { |g| g.id }.sort
- end
- end
-
- def test_gems_secondary_path
- repo do |extra|
- bar = gem "bar"
-
- repo extra.home do |r|
- assert_equal [bar], r.gems.wrapped
- end
- end
- end
-
def test_to_s
r = Gem::Repo.new "foo"
assert_match "Gem::Repo", r.to_s
Please sign in to comment.
Something went wrong with that request. Please try again.