summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pathname/test_pathname.rb3
-rw-r--r--test/ruby/envutil.rb8
2 files changed, 7 insertions, 4 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 6ad95441ee..94bcffafbd 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -7,6 +7,8 @@ require 'fileutils'
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 @@ class TestPathname < Test::Unit::TestCase
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
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index 0d5632d4d9..5e467a1c0a 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -138,15 +138,15 @@ module Test
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={})