summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-10 00:46:22 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-10 00:46:22 +0900
commitc302b86fa0a24541e9fd642f4f93ca397ef7e216 (patch)
tree7ab0e915f1602d987a092f150d37d9a884783089
parent48ac1f74f199d2845e107979e6908ff1418e90bf (diff)
parentfaee6987464691436818e6f6b5757634ccbff98d (diff)
downloadmruby-c302b86fa0a24541e9fd642f4f93ca397ef7e216.tar.gz
mruby-c302b86fa0a24541e9fd642f4f93ca397ef7e216.zip
Merge pull request #2220 from yui-knk/refactor-test
Refactoring test to use assert_nothing_raised.
-rw-r--r--test/t/exception.rb12
-rw-r--r--test/t/string.rb6
2 files changed, 11 insertions, 7 deletions
diff --git a/test/t/exception.rb b/test/t/exception.rb
index 0ce742527..c670d15cd 100644
--- a/test/t/exception.rb
+++ b/test/t/exception.rb
@@ -345,13 +345,13 @@ assert('Exception#inspect without message') do
end
assert('Exception#backtrace') do
- begin
- raise "get backtrace"
- rescue => e
- e.backtrace
+ assert_nothing_raised do
+ begin
+ raise "get backtrace"
+ rescue => e
+ e.backtrace
+ end
end
-
- true
end
assert('Raise in ensure') do
diff --git a/test/t/string.rb b/test/t/string.rb
index a2a020a79..5ecb51530 100644
--- a/test/t/string.rb
+++ b/test/t/string.rb
@@ -476,7 +476,11 @@ assert('String#upcase!', '15.2.10.5.43') do
end
assert('String#inspect', '15.2.10.5.46') do
- ("\1" * 100).inspect # should not raise an exception - regress #1210
+ # should not raise an exception - regress #1210
+ assert_nothing_raised do
+ ("\1" * 100).inspect
+ end
+
assert_equal "\"\\000\"", "\0".inspect
end