diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-14 02:02:12 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-14 02:02:12 +0000 |
commit | f52c2cc24d1070f1997921c1d870cdd55327ba2a (patch) | |
tree | 4cc19851c0a696bda9d17671ed15b980409bdce5 /test | |
parent | 8409156e243f670590708742354c8af6a99def3b (diff) | |
download | ruby-f52c2cc24d1070f1997921c1d870cdd55327ba2a.tar.gz |
Reduced gem_prelude to just require rubygems. Reviewed by Evan Phoenix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 11 | ||||
-rw-r--r-- | test/ruby/test_thread.rb | 2 | ||||
-rw-r--r-- | test/rubygems/gemutilities.rb | 6 | ||||
-rw-r--r-- | test/test_tracer.rb | 6 | ||||
-rw-r--r-- | test/webrick/test_filehandler.rb | 7 |
6 files changed, 20 insertions, 16 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 7e96b4062a..55bae0650b 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1210,8 +1210,8 @@ class TestProcess < Test::Unit::TestCase Dir.chdir("vd") { dir = "#{d}/vd" # OpenSolaris cannot remove the current directory. - system(RUBY, "-e", "Dir.chdir '..'; Dir.rmdir #{dir.dump}") - system({"RUBYLIB"=>nil}, RUBY, "-e", "exit true") + system(RUBY, "--disable-gems", "-e", "Dir.chdir '..'; Dir.rmdir #{dir.dump}") + system({"RUBYLIB"=>nil}, RUBY, "--disable-gems", "-e", "exit true") status = $? } assert(status.success?, "[ruby-dev:38105]") diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index d125b2c078..c483d1f216 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -57,13 +57,14 @@ class TestRubyOptions < Test::Unit::TestCase end def test_debug - assert_in_out_err(%w(-de) + ["p $DEBUG"], "", %w(true), []) + assert_in_out_err(["--disable-gems", "-de", "p $DEBUG"], "", %w(true), []) - assert_in_out_err(%w(--debug -e) + ["p $DEBUG"], "", %w(true), []) + assert_in_out_err(["--disable-gems", "--debug", "-e", "p $DEBUG"], + "", %w(true), []) end def test_verbose - assert_in_out_err(%w(-vve) + [""]) do |r, e| + assert_in_out_err(["-vve", ""]) do |r, e| assert_match(/^ruby #{RUBY_VERSION}(?:[p ]|dev).*? \[#{RUBY_PLATFORM}\]$/, r.join) assert_equal RUBY_DESCRIPTION, r.join.chomp assert_equal([], e) @@ -209,10 +210,10 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err([], "", [], /invalid switch in RUBYOPT: -e \(RuntimeError\)/) ENV['RUBYOPT'] = '-T1' - assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/) + assert_in_out_err(["--disable-gems"], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/) ENV['RUBYOPT'] = '-T4' - assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/) + assert_in_out_err(["--disable-gems"], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/) ENV['RUBYOPT'] = '-Eus-ascii -KN' assert_in_out_err(%w(-Eutf-8 -KU), "p '\u3042'") do |r, e| diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 0322448c71..bc0be1e4d2 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -271,7 +271,7 @@ class TestThread < Test::Unit::TestCase end INPUT - assert_in_out_err(%w(-d), <<-INPUT, %w(false 2), /.+/) + assert_in_out_err(%w(--disable-gems -d), <<-INPUT, %w(false 2), /.+/) p Thread.abort_on_exception begin Thread.new { raise } diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb index 803cd26c96..66914d0c0e 100644 --- a/test/rubygems/gemutilities.rb +++ b/test/rubygems/gemutilities.rb @@ -2,11 +2,7 @@ at_exit { $SAFE = 1 } $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -if RUBY_VERSION > '1.9' then - Gem::QuickLoader.load_full_rubygems_library -else - require 'rubygems' -end +require 'rubygems' require 'fileutils' require 'minitest/autorun' require 'tmpdir' diff --git a/test/test_tracer.rb b/test/test_tracer.rb index 2580205338..8f542e6e84 100644 --- a/test/test_tracer.rb +++ b/test/test_tracer.rb @@ -5,16 +5,16 @@ class TestTracer < Test::Unit::TestCase include EnvUtil def test_work_with_e - assert_in_out_err(%w[-rtracer -e 1]) do |(*lines),| + assert_in_out_err(%w[--disable-gems -rtracer -e 1]) do |(*lines),| case lines.size when 2 assert_match %r[#0:<internal:lib/rubygems/custom_require>:\d+:Kernel:<: -], lines[0] when 1 # do nothing else - flunk 'unexpected output from `ruby -rtracer -e 1`' + flunk "unexpected output from `ruby -rtracer -e 1`" end - assert_equal "#0:-e:1::-: 1", lines[1] + assert_equal "#0:-e:1::-: 1", lines.last end end end diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 7ab86a8fb7..e4b672af8d 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -241,6 +241,13 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase :CGIInterpreter => TestWEBrick::RubyBin, :DocumentRoot => File.dirname(__FILE__), :CGIPathEnv => ENV['PATH'], + :RequestCallback => Proc.new{|req, res| + def req.meta_vars + meta = super + meta["RUBYLIB"] = $:.join(File::PATH_SEPARATOR) + return meta + end + }, } TestWEBrick.start_httpserver(config) do |server, addr, port, log| http = Net::HTTP.new(addr, port) |