test/unit/assertions/assert_raises_tests.rb in assert-2.17.0 vs test/unit/assertions/assert_raises_tests.rb in assert-2.18.0
- old
+ new
@@ -1,10 +1,9 @@
require "assert"
require "assert/assertions"
module Assert::Assertions
-
class AssertRaisesTests < Assert::Context
include Assert::Test::TestHelpers
desc "`assert_raises`"
setup do
@@ -32,11 +31,11 @@
"#{@d}\nRuntimeError exception expected, not:",
"#{@d}\nRuntimeError exception expected but nothing raised.",
"#{@d}\nAn exception expected but nothing raised."
]
messages = test_run_results(:fail).map(&:message)
- messages.each_with_index{ |msg, n| assert_match /^#{exp[n]}/, msg }
+ messages.each_with_index{ |msg, n| assert_match(/^#{exp[n]}/, msg) }
end
should "return any raised exception instance" do
error = nil
error_msg = Factory.string
@@ -54,11 +53,10 @@
end
test.run
assert_nil error
end
-
end
class AssertNothingRaisedTests < Assert::Context
include Assert::Test::TestHelpers
@@ -86,12 +84,10 @@
exp = [
"#{@d}\nStandardError or RuntimeError exception not expected, but raised:",
"#{@d}\nAn exception not expected, but raised:"
]
messages = test_run_results(:fail).map(&:message)
- messages.each_with_index{ |msg, n| assert_match /^#{exp[n]}/, msg }
+ messages.each_with_index{ |msg, n| assert_match(/^#{exp[n]}/, msg) }
end
-
end
-
end