1 require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
2 require 'rubygems/gem_runner'
4 class TestGemGemRunner < RubyGemTestCase
6 def test_do_configuration
9 temp_conf = File.join @tempdir, '.gemrc'
11 other_gem_path = File.join @tempdir, 'other_gem_path'
12 other_gem_home = File.join @tempdir, 'other_gem_home'
14 Gem.ensure_gem_subdirectories other_gem_path
15 Gem.ensure_gem_subdirectories other_gem_home
17 File.open temp_conf, 'w' do |fp|
18 fp.puts "gem: --commands"
19 fp.puts "gemhome: #{other_gem_home}"
21 fp.puts " - #{other_gem_path}"
25 gr = Gem::GemRunner.new
26 gr.send :do_configuration, %W[--config-file #{temp_conf}]
28 assert_equal [other_gem_path, other_gem_home], Gem.path
29 assert_equal %w[--commands], Gem::Command.extra_args
30 assert_equal %w[--all], Gem::DocManager.configured_args