test/support/assert_helpers.rb in optimist-3.1.0 vs test/support/assert_helpers.rb in optimist-3.2.0
- old
+ new
@@ -40,7 +40,13 @@
} if status
return true
end
flunk "#{msg}#{mu_pp(exp)} SystemExit expected but nothing was raised."
end
+
+ # wrapper around common assertion checking pattern
+ def assert_raises_errmatch(err_klass, err_regexp, &b)
+ err = assert_raises(err_klass, &b)
+ assert_match(err_regexp, err.message)
+ end
end