Skip to content

Commit

Permalink
Restore ARGV to fix test falure on ruby test-all
Browse files Browse the repository at this point in the history
Restore ARGV properly, non-ascii strings in different encodings are not equal.
This should fix parallel test failure on ruby repository.

http://bugs.ruby-lang.org/issues/6673
[ruby-core:45975]
  • Loading branch information
shirosaki committed Sep 27, 2012
1 parent d41bf95 commit e8d1693
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/rubygems/test_gem_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@ def test_install_creates_binstub_that_dont_trust_encoding

exe = File.join @gemhome, 'bin', 'executable'

ARGV.unshift "\xE4pfel".force_encoding("UTF-8")
extra_arg = "\xE4pfel".force_encoding("UTF-8")
ARGV.unshift extra_arg

begin
Gem::Specification.reset
Expand All @@ -775,7 +776,7 @@ def test_install_creates_binstub_that_dont_trust_encoding
instance_eval File.read(exe)
end
ensure
ARGV.shift if ARGV.first == "\xE4pfel"
ARGV.shift if ARGV.first == extra_arg
end

assert_match(/ran executable/, e.message)
Expand Down

0 comments on commit e8d1693

Please sign in to comment.