From 12e31f28c2149d3b82e75ab101c65b6bdd9d5563 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 25 Oct 2015 12:31:35 +0200 Subject: [PATCH] fix and test class definition --- lib/parfait/class.rb | 2 +- test/compiler/fragments/test_all.rb | 2 +- test/compiler/fragments/test_class.rb | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/parfait/class.rb b/lib/parfait/class.rb index b153937e..5a732423 100644 --- a/lib/parfait/class.rb +++ b/lib/parfait/class.rb @@ -22,7 +22,7 @@ module Parfait class Class < Object attributes [:object_layout , :name , :instance_methods , :super_class , :meta_class] - def initialize name , super_class + def initialize name , superclass super() self.name = name self.instance_methods = List.new diff --git a/test/compiler/fragments/test_all.rb b/test/compiler/fragments/test_all.rb index 6caa2b14..f0e8d4f1 100644 --- a/test/compiler/fragments/test_all.rb +++ b/test/compiler/fragments/test_all.rb @@ -2,7 +2,7 @@ require_relative "test_if" #require_relative "test_foo" #require_relative "test_hello" -#require_relative "test_class" +require_relative "test_class" #require_relative "test_putint" #require_relative "test_functions" #require_relative "test_recursive_fibo" diff --git a/test/compiler/fragments/test_class.rb b/test/compiler/fragments/test_class.rb index a6845a5c..1262b38c 100644 --- a/test/compiler/fragments/test_class.rb +++ b/test/compiler/fragments/test_class.rb @@ -1,19 +1,24 @@ require_relative 'helper' +module Register class TestBasicClass < MiniTest::Test include Fragments - def test_class_basic + def test_class_def @string_input = <