mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add with_message modifier to raise_error matcher
This commit is contained in:
parent
6a0a73ca76
commit
d5c5a82395
1 changed files with 5 additions and 0 deletions
|
@ -90,6 +90,11 @@ module Spectator::Matchers
|
|||
end
|
||||
end
|
||||
|
||||
def with_message(message : T) forall T
|
||||
value = TestValue.new(message)
|
||||
ExceptionMatcher(ExceptionType, T).new(value)
|
||||
end
|
||||
|
||||
# Runs a block of code and returns the exception it threw.
|
||||
# If no exception was thrown, *nil* is returned.
|
||||
private def capture_exception
|
||||
|
|
Loading…
Reference in a new issue