* 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
This commit is contained in:
usa 2014-09-18 07:30:19 +00:00
Родитель 5de2bb431a
Коммит c825eee9ea
2 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Thu Sep 18 16:26:27 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* 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.
Thu Sep 18 15:02:15 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* test/rubygems/test_gem_specification.rb: '/' is not always the root.

Просмотреть файл

@ -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