[前][次][番号順一覧][スレッド一覧]

ruby-changes:30331

From: nobu <ko1@a...>
Date: Mon, 5 Aug 2013 17:33:01 +0900 (JST)
Subject: [ruby-changes:30331] nobu:r42383 (trunk): test_econv.rb: assert_separately

nobu	2013-08-05 17:32:49 +0900 (Mon, 05 Aug 2013)

  New Revision: 42383

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42383

  Log:
    test_econv.rb: assert_separately
    
    * test/ruby/test_econv.rb (test_default_external): use
      assert_separately for clearer messages.

  Modified files:
    trunk/test/ruby/test_econv.rb

Index: test/ruby/test_econv.rb
===================================================================
--- test/ruby/test_econv.rb	(revision 42382)
+++ test/ruby/test_econv.rb	(revision 42383)
@@ -911,21 +911,14 @@ class TestEncodingConverter < Test::Unit https://github.com/ruby/ruby/blob/trunk/test/ruby/test_econv.rb#L911
   end
 
   def test_default_external
-    cmd = <<EOS
+    Encoding.list.grep(->(enc) {/\AISO-8859-\d+\z/i =~ enc.name}) do |enc|
+      assert_separately(%W[--disable=gems -d - #{enc.name}], <<-EOS, ignore_stderr: true)
     Encoding.default_external = ext = ARGV[0]
     Encoding.default_internal = int ='utf-8'
-    begin
+    assert_nothing_raised do
       Encoding::Converter.new(ext, int)
-    ensure
-      Marshal.dump($!, STDOUT)
-      STDOUT.flush
     end
-EOS
-    Encoding.list.grep(->(enc) {/\AISO-8859-\d+\z/i =~ enc.name}) do |enc|
-      error = IO.popen([EnvUtil.rubybin, "-e", cmd, enc.name, err: File::NULL]) do |child|
-        Marshal.load(child)
-      end
-      assert_nil(error)
+    EOS
     end
   end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]