Merge branch 'tamuratak-ruby_simple_assertion'
* tamuratak-ruby_simple_assertion: Rename new Ruby assert functions used in test-suite [ruby] add simple assertions.
This commit is contained in:
commit
ceea1d9905
1 changed files with 16 additions and 6 deletions
|
|
@ -1,12 +1,7 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
#
|
#
|
||||||
# A simple function to create useful asserts
|
# Useful assert functions
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Exception raised when some swig binding test fails
|
# Exception raised when some swig binding test fails
|
||||||
|
|
@ -15,6 +10,21 @@ class SwigRubyError < RuntimeError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Simple assertions. Strings are not needed as arguments.
|
||||||
|
#
|
||||||
|
def swig_assert_equal_simple(a, b)
|
||||||
|
unless a == b
|
||||||
|
raise SwigRubyError.new("\n#{a} expected but was \n#{b}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def swig_assert_simple(a)
|
||||||
|
unless a
|
||||||
|
raise SwigRubyError.new("assertion falied.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Asserts whether a and b are equal.
|
# Asserts whether a and b are equal.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue