From 4a21c8cc27d903fa0b8457a33c75e2c2901f0918 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 28 Oct 2013 04:11:20 +0000 Subject: [PATCH] test_exception.rb: missing test * test/ruby/test_exception.rb (test_to_s): missing test for r30455. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 95db1308e7..cc4dcb7b7f 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -288,6 +288,17 @@ end.join assert_equal(e.inspect, e.new.inspect) end + def test_to_s + e = StandardError.new("foo") + assert_equal("foo", e.to_s) + + def (s = Object.new).to_s + "bar" + end + e = StandardError.new(s) + assert_equal("bar", e.to_s) + end + def test_set_backtrace e = Exception.new