* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
261bb184c6
commit
6bc65b35bd
@ -1,3 +1,11 @@
|
|||||||
|
Sat Aug 7 09:28:12 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* 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@fsij.org>
|
Sat Aug 7 08:26:26 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/pathname/pathname.c (path_chown): Pathname#chown translated
|
* ext/pathname/pathname.c (path_chown): Pathname#chown translated
|
||||||
|
@ -7,6 +7,8 @@ require 'fileutils'
|
|||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'enumerator'
|
require 'enumerator'
|
||||||
|
|
||||||
|
require_relative '../ruby/envutil'
|
||||||
|
|
||||||
class TestPathname < Test::Unit::TestCase
|
class TestPathname < Test::Unit::TestCase
|
||||||
def self.define_assertion(name, &block)
|
def self.define_assertion(name, &block)
|
||||||
@defassert_num ||= {}
|
@defassert_num ||= {}
|
||||||
@ -732,6 +734,7 @@ class TestPathname < Test::Unit::TestCase
|
|||||||
File.symlink("a", "l")
|
File.symlink("a", "l")
|
||||||
path = Pathname("l")
|
path = Pathname("l")
|
||||||
old = path.lstat.mode
|
old = path.lstat.mode
|
||||||
|
assert_normal_exit %{ require "pathname"; Pathname("foo").lchmod(nil) }
|
||||||
begin
|
begin
|
||||||
path.lchmod(0444)
|
path.lchmod(0444)
|
||||||
rescue NotImplementedError
|
rescue NotImplementedError
|
||||||
|
@ -138,15 +138,15 @@ module Test
|
|||||||
if !message.empty?
|
if !message.empty?
|
||||||
full_message << message << "\n"
|
full_message << message << "\n"
|
||||||
end
|
end
|
||||||
if msg.empty?
|
if message.empty?
|
||||||
full_message << "pid #{pid} killed by #{sigdesc}"
|
full_message << "pid #{pid} killed by #{sigdesc}"
|
||||||
else
|
else
|
||||||
msg << "\n" if /\n\z/ !~ msg
|
message << "\n" if /\n\z/ !~ message
|
||||||
full_message << "pid #{pid} killed by #{sigdesc}\n#{msg.gsub(/^/, '| ')}"
|
full_message << "pid #{pid} killed by #{sigdesc}\n#{message.gsub(/^/, '| ')}"
|
||||||
end
|
end
|
||||||
full_message
|
full_message
|
||||||
end
|
end
|
||||||
assert_block(faildesc) { !status.signaled? }
|
assert !status.signaled?, faildesc
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil, opt={})
|
def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil, opt={})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user