diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-18 07:30:19 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-18 07:30:19 +0000 |
commit | c825eee9ea12cb3557dbba37ef78672265c0bdc3 (patch) | |
tree | 1140e9b30abb175f65cd35d0795e387a64f39d34 /test | |
parent | 5de2bb431a88466d669d0a743b8a12dd0c434027 (diff) | |
download | ruby-c825eee9ea12cb3557dbba37ef78672265c0bdc3.tar.gz |
* test/rubygems/test_gem_commands_setup_command.rb: @ui uses StringIO
as its streams, and Encoding.default_external does not effect to
stringIOs already exist. so, we need to set external_encoding of
@ui.outs directly. this problem (test failure) does not appear in
the environments default_external is us-ascii or utf-8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem_commands_setup_command.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb index 2fe3384954..974c157a18 100644 --- a/test/rubygems/test_gem_commands_setup_command.rb +++ b/test/rubygems/test_gem_commands_setup_command.rb @@ -77,10 +77,10 @@ class TestGemCommandsSetupCommand < Gem::TestCase def test_show_release_notes @default_external = nil - capture_io do - @default_external, Encoding.default_external = - Encoding.default_external, Encoding::US_ASCII - end if Object.const_defined? :Encoding + if Object.const_defined? :Encoding + @default_external = @ui.outs.external_encoding + @ui.outs.set_encoding Encoding::US_ASCII + end @cmd.options[:previous_version] = Gem::Version.new '2.0.2' @@ -127,11 +127,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase output = @ui.output output.force_encoding Encoding::UTF_8 if Object.const_defined? :Encoding - assert_equal expected, @ui.output + assert_equal expected, output ensure - capture_io do - Encoding.default_external = @default_external - end if @default_external + @ui.outs.set_encoding @default_external if @default_external end end |