rubyx/test/parfait_ruby/test_method.rb
Torsten Ruger 40d81681b5 move parfait adapter into parfait ruby
in the future parfait will be coded in some and translated back into
ruby to “adapt”
until then, all ruby code is the adapter
2015-11-18 11:55:29 +02:00

24 lines
605 B
Ruby

require_relative "../helper"
class TestMethod < MiniTest::Test
def setup
obj = Register.machine.boot.space.get_class_by_name(:Object)
args = Parfait.new_list [ Parfait::Variable.new(:Integer , :bar )]
@method = ::Parfait::Method.new obj , :foo , args
end
def test_method_name
assert_equal :foo , @method.name
end
def test_arg1
assert_equal 1 , @method.arguments.get_length
assert_equal Parfait::Variable , @method.arguments.first.class
assert_equal :bar , @method.arguments.first.name
end
def test_has_arg
assert_equal 1 , @method.has_arg(:bar)
end
end