PageRenderTime 53ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. #!/usr/bin/env ruby
  2. #
  3. # Put description here
  4. #
  5. #
  6. #
  7. #
  8. #
  9. require 'swig_assert'
  10. require 'throw_exception'
  11. include Throw_exception
  12. foo = Foo.new
  13. begin
  14. foo.test_int
  15. rescue => ex
  16. raise RuntimeError if ex.message != "37"
  17. end
  18. begin
  19. foo.test_msg
  20. rescue => ex
  21. raise RuntimeError if ex.message != "Dead"
  22. end
  23. begin
  24. foo.test_multi(1)
  25. rescue => ex
  26. raise RuntimeError if ex.message != "37"
  27. end
  28. begin
  29. foo.test_multi(2)
  30. rescue => ex
  31. raise RuntimeError if ex.message != "Dead"
  32. end