aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_exception.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r--test/ruby/test_exception.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 6532fecea9..feda30644f 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1255,12 +1255,12 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
_, err2, status1 = EnvUtil.invoke_ruby(['-e', "#{test_method}; begin; foo; end"], '', true, true)
assert_equal(err2, out1)
- if $stderr.tty?
- e = RuntimeError.new("a\n")
- message = assert_nothing_raised(ArgumentError, proc {e.pretty_inspect}) do
- e.full_message
- end
- assert_operator(message, :end_with?, "\n")
+ e = RuntimeError.new("a\n")
+ message = assert_nothing_raised(ArgumentError, proc {e.pretty_inspect}) do
+ e.full_message
end
+ assert_operator(message, :end_with?, "\n")
+ message = message.gsub(/\e\[[\d;]*m/, '')
+ assert_not_operator(message, :end_with?, "\n\n")
end
end