Add test for Test::Unit::CoreAssertions#assert_raise_with_message
This commit is contained in:
parent
87426f57c9
commit
ae94fca788
Notes:
git
2025-01-24 07:59:41 +00:00
@ -27,6 +27,26 @@ class TestAssertion < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_assert_raise_with_message
|
||||
my_error = Class.new(StandardError)
|
||||
|
||||
assert_raise_with_message(my_error, "with message") do
|
||||
raise my_error, "with message"
|
||||
end
|
||||
|
||||
assert_raise(Test::Unit::AssertionFailedError) do
|
||||
assert_raise_with_message(RuntimeError, "with message") do
|
||||
raise my_error, "with message"
|
||||
end
|
||||
end
|
||||
|
||||
assert_raise(Test::Unit::AssertionFailedError) do
|
||||
assert_raise_with_message(my_error, "without message") do
|
||||
raise my_error, "with message"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_assert_pattern_list
|
||||
assert_pattern_list([/foo?/], "foo")
|
||||
assert_not_pattern_list([/foo?/], "afoo")
|
||||
|
Loading…
x
Reference in New Issue
Block a user