ruby-changes:16896
From: akr <ko1@a...>
Date: Sat, 7 Aug 2010 09:30:08 +0900 (JST)
Subject: [ruby-changes:16896] Ruby:r28892 (trunk): * test/ruby/envutil.rb (assert_normal_exit): use assert. fix
akr 2010-08-07 09:29:52 +0900 (Sat, 07 Aug 2010) New Revision: 28892 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28892 Log: * test/ruby/envutil.rb (assert_normal_exit): use assert. fix faildesc. * test/pathname/test_pathname.rb (test_lchmod): test Pathname#lchmod using assert_normal_exit. Modified files: trunk/ChangeLog trunk/test/pathname/test_pathname.rb trunk/test/ruby/envutil.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 28891) +++ ChangeLog (revision 28892) @@ -1,3 +1,11 @@ +Sat Aug 7 09:28:12 2010 Tanaka Akira <akr@f...> + + * test/ruby/envutil.rb (assert_normal_exit): use assert. fix + faildesc. + + * test/pathname/test_pathname.rb (test_lchmod): test Pathname#lchmod + using assert_normal_exit. + Sat Aug 7 08:26:26 2010 Tanaka Akira <akr@f...> * ext/pathname/pathname.c (path_chown): Pathname#chown translated Index: test/ruby/envutil.rb =================================================================== --- test/ruby/envutil.rb (revision 28891) +++ test/ruby/envutil.rb (revision 28892) @@ -138,15 +138,15 @@ if !message.empty? full_message << message << "\n" end - if msg.empty? + if message.empty? full_message << "pid #{pid} killed by #{sigdesc}" else - msg << "\n" if /\n\z/ !~ msg - full_message << "pid #{pid} killed by #{sigdesc}\n#{msg.gsub(/^/, '| ')}" + message << "\n" if /\n\z/ !~ message + full_message << "pid #{pid} killed by #{sigdesc}\n#{message.gsub(/^/, '| ')}" end full_message end - assert_block(faildesc) { !status.signaled? } + assert !status.signaled?, faildesc end def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil, opt={}) Index: test/pathname/test_pathname.rb =================================================================== --- test/pathname/test_pathname.rb (revision 28891) +++ test/pathname/test_pathname.rb (revision 28892) @@ -7,6 +7,8 @@ require 'tmpdir' require 'enumerator' +require_relative '../ruby/envutil' + class TestPathname < Test::Unit::TestCase def self.define_assertion(name, &block) @defassert_num ||= {} @@ -732,6 +734,7 @@ File.symlink("a", "l") path = Pathname("l") old = path.lstat.mode + assert_normal_exit %{ require "pathname"; Pathname("foo").lchmod(nil) } begin path.lchmod(0444) rescue NotImplementedError -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/