diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-23 15:22:13 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-23 15:22:13 +0000 |
commit | ebadc3faaf095ba6359c50cc33b657c2f6fed983 (patch) | |
tree | de1333bc139328e336cb974ab6f33644a72b97ea /test/ruby/test_rubyoptions.rb | |
parent | 5b4ca970262a96864a657ceb7bce9fd136949764 (diff) | |
download | ruby-ebadc3faaf095ba6359c50cc33b657c2f6fed983.tar.gz ruby-ebadc3faaf095ba6359c50cc33b657c2f6fed983.tar.xz ruby-ebadc3faaf095ba6359c50cc33b657c2f6fed983.zip |
* test/ruby/test_settracefunc.rb: add a test for set_trace_func.
* test/ruby/envutil.rb: move "rubyexec" method from test_rubyoptions.rb.
* test/ruby/test_rubyoptions.rb: use rubyexec in envutil.rb.
* test/ruby/test_thread.rb: add tests to achieve over 90% test coverage
of thread.c.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 316f313a2..3304a17eb 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -1,44 +1,12 @@ require 'test/unit' -require 'timeout' require 'tmpdir' require 'tempfile' -require 'open3' require_relative 'envutil' class TestRubyOptions < Test::Unit::TestCase - -unless /(mswin|bccwin|mingw|emx)/ =~ RUBY_PLATFORM - - LANG_ENVS = %w"LANG LC_ALL LC_CTYPE" - def ruby(*args) - ruby = EnvUtil.rubybin - c = "C" - env = {} - LANG_ENVS.each {|lc| env[lc], ENV[lc] = ENV[lc], c} - stdin, stdout, stderr = Open3.popen3(*([ruby] + args)) - env.each_pair {|lc, v| - if v - ENV[lc] = v - else - ENV.delete(lc) - end - } - env = nil - Timeout.timeout(10) do - yield(stdin, stdout, stderr) - end - ensure - env.each_pair {|lc, v| - if v - ENV[lc] = v - else - ENV.delete(lc) - end - } if env - stdin .close unless !stdin || stdin .closed? - stdout.close unless !stdout || stdout.closed? - stderr.close unless !stderr || stderr.closed? + def ruby(*r, &b) + EnvUtil.rubyexec(*r, &b) end def test_source_file @@ -484,13 +452,4 @@ unless /(mswin|bccwin|mingw|emx)/ =~ RUBY_PLATFORM assert_equal('', r.read.chomp) end end - -else - - def test_win32 - flunk("cannot test in win32") - end - -end - end |