diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-26 04:19:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-26 04:19:56 +0000 |
commit | 45c4d828233898f4164aaabca6dfb68a38e04a57 (patch) | |
tree | 6cbee278f179fdbf712bf95f762f1bb3034a4eb9 | |
parent | 4af852faa2ede75869debebeb04869c4cfbfb5a6 (diff) |
test_require.rb: same process
* test/ruby/test_require.rb (assert_require_nonascii_path): run in
same process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_require.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index e3da03606b..68ce1196dd 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -78,17 +78,21 @@ class TestRequire < Test::Unit::TestCase end Dir.mkdir(File.dirname(require_path)) open(require_path, "wb") {} - assert_separately(%w[--disable=gems], <<-INPUT) + begin + load_path = $:.dup + features = $".dup # leave paths for require encoding objects bug = "#{bug} require #{encoding} path" require_path = "#{require_path}" - enc_path = Regexp.new(Regexp.escape(RUBY_PLATFORM)) - $:.replace([IO::NULL] + $:.reject {|path| enc_path !~ path}) + $:.clear assert_nothing_raised(LoadError, bug) { assert(require(require_path), bug) assert(!require(require_path), bug) } - INPUT + ensure + $:.replace(load_path) + $".replace(features) + end } end |