mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove assert methods
This commit is contained in:
parent
f97e5365e3
commit
98a29309ff
1 changed files with 0 additions and 22 deletions
|
@ -13,28 +13,6 @@ module Spectator::DSL
|
|||
raise AssertionFailed.new(Source.new(_file, _line), message)
|
||||
end
|
||||
|
||||
# Checks that the specified condition is true.
|
||||
# Raises `AssertionFailed` if *condition* is false.
|
||||
# The *message* is passed to the exception.
|
||||
#
|
||||
# ```
|
||||
# assert(value == 42, "That's not the answer to everything.")
|
||||
# ```
|
||||
def assert(condition, message, *, _file = __FILE__, _line = __LINE__)
|
||||
fail(message, _file: _file, _line: _line) unless condition
|
||||
end
|
||||
|
||||
# Checks that the specified condition is true.
|
||||
# Raises `AssertionFailed` if *condition* is false.
|
||||
# The message of the exception is the *condition*.
|
||||
#
|
||||
# ```
|
||||
# assert(value == 42)
|
||||
# ```
|
||||
macro assert(condition)
|
||||
assert({{condition}}, {{condition.stringify}}, _file: {{condition.filename}}, _line: {{condition.line_number}})
|
||||
end
|
||||
|
||||
# Starts an expectation.
|
||||
# This should be followed up with `Assertion::Target#to` or `Assertion::Target#to_not`.
|
||||
# The value passed in will be checked to see if it satisfies the conditions of the specified matcher.
|
||||
|
|
Loading…
Reference in a new issue