From c2ae184e6e805a1251338be9a872a5e86e7ab22e Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 7 Aug 2014 15:41:13 +0300 Subject: [PATCH] simple test for get type --- lib/boot/boot_class.rb | 4 ++-- lib/parfait/message.rb | 6 +++--- lib/parfait/object.rb | 4 ++-- test/virtual/test_machine.rb | 13 +++++++++++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/boot/boot_class.rb b/lib/boot/boot_class.rb index 8fcedece..4b3c78c1 100644 --- a/lib/boot/boot_class.rb +++ b/lib/boot/boot_class.rb @@ -12,9 +12,9 @@ module Boot @super_class_name = super_class_name.to_sym @meta_class = MetaClass.new(self) end - attr_reader :name , :methods , :meta_class , :context , :super_class + attr_reader :name , :methods , :meta_class , :context , :super_class_name def attributes - [:name , :super_class] + [:name , :super_class_name] end def add_method_definition method raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Virtual::MethodDefinition diff --git a/lib/parfait/message.rb b/lib/parfait/message.rb index b307dac3..5f1b8fda 100644 --- a/lib/parfait/message.rb +++ b/lib/parfait/message.rb @@ -3,9 +3,9 @@ class Message - def get_type_for name - index = @layout.get_index name - get_at index + def get_type_for(name) + index = @layout.get_index(name) + get_at(index) end def send diff --git a/lib/parfait/object.rb b/lib/parfait/object.rb index efdceec8..e63c18a5 100644 --- a/lib/parfait/object.rb +++ b/lib/parfait/object.rb @@ -3,7 +3,7 @@ class Object - def get_class - @layout.get_class + def get_class() + @layout.get_class() end end diff --git a/test/virtual/test_machine.rb b/test/virtual/test_machine.rb index 1cb513d4..452ec2a8 100644 --- a/test/virtual/test_machine.rb +++ b/test/virtual/test_machine.rb @@ -15,4 +15,17 @@ HERE check end + def test_message_tpye + @string_input = <