/trunk/Examples/test-suite/ruby/throw_exception_runme.rb
Ruby | 41 lines | 24 code | 9 blank | 8 comment | 8 complexity | 1d8aa529a57feef005fbc7a239d3e982 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- #!/usr/bin/env ruby
- #
- # Put description here
- #
- #
- #
- #
- #
- require 'swig_assert'
- require 'throw_exception'
- include Throw_exception
- foo = Foo.new
- begin
- foo.test_int
- rescue => ex
- raise RuntimeError if ex.message != "37"
- end
- begin
- foo.test_msg
- rescue => ex
- raise RuntimeError if ex.message != "Dead"
- end
- begin
- foo.test_multi(1)
- rescue => ex
- raise RuntimeError if ex.message != "37"
- end
- begin
- foo.test_multi(2)
- rescue => ex
- raise RuntimeError if ex.message != "Dead"
- end