diff --git a/Examples/test-suite/ruby/swig_assert.rb b/Examples/test-suite/ruby/swig_assert.rb index 69a1a0207..2d5d1f406 100644 --- a/Examples/test-suite/ruby/swig_assert.rb +++ b/Examples/test-suite/ruby/swig_assert.rb @@ -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. #