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:
William S Fulton 2017-03-31 07:32:28 +01:00
commit ceea1d9905

View file

@ -1,12 +1,7 @@
#!/usr/bin/env ruby
#
# A simple function to create useful asserts
# Useful assert functions
#
#
#
#
#
#
# Exception raised when some swig binding test fails
@ -15,6 +10,21 @@ class SwigRubyError < RuntimeError
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.
#