/trunk/Examples/test-suite/ruby/li_factory_runme.rb
Ruby | 38 lines | 22 code | 8 blank | 8 comment | 12 complexity | 7c40f425b98e3b072fee82a0c3064551 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 'li_factory'
- circle = Li_factory::Geometry.create(Li_factory::Geometry::CIRCLE)
- r = circle.radius()
- if (r != 1.5)
- raise RuntimeError, "Invalid value for r"
- end
- new_circle = circle.clone()
- r = new_circle.radius()
- if (r != 1.5)
- raise RuntimeError, "Invalid value for r"
- end
- point = Li_factory::Geometry.create(Li_factory::Geometry::POINT)
- w = point.width()
- if (w != 1.0)
- raise RuntimeError, "Invalid value for w"
- end
- new_point = point.clone()
- w = new_point.width()
- if (w != 1.0)
- raise RuntimeError, "Invalid value for w"
- end