[ruby] add simple assertions.
This commit is contained in:
parent
5498955931
commit
b8d383cb4a
1 changed files with 15 additions and 0 deletions
|
|
@ -15,6 +15,21 @@ class SwigRubyError < RuntimeError
|
|||
end
|
||||
|
||||
|
||||
#
|
||||
# simple assertions. strings are not needed as arguments.
|
||||
#
|
||||
def simple_assert_equal(a, b)
|
||||
unless a == b
|
||||
raise SwigRubyError.new("\n#{a} expected but was \n#{b}")
|
||||
end
|
||||
end
|
||||
|
||||
def simple_assert(a)
|
||||
unless a
|
||||
raise SwigRubyError.new("assertion falied.")
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Asserts whether a and b are equal.
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue