create and test derived classes too
This commit is contained in:
@ -3,15 +3,20 @@ require_relative "helper"
|
||||
module Melon
|
||||
class TestClass < MiniTest::Test
|
||||
|
||||
def test_creates_class
|
||||
Register.machine.boot
|
||||
before = Parfait::Space.object_space.classes.length
|
||||
@string_input = <<HERE
|
||||
class Testing
|
||||
end
|
||||
HERE
|
||||
Compiler.compile @string_input
|
||||
assert_equal 1 , Parfait::Space.object_space.classes.length - before , "No classes created"
|
||||
def setup
|
||||
Register.machine.boot unless Register.machine.booted
|
||||
end
|
||||
def test_creates_class_without_deriviation
|
||||
Compiler.compile "class Testing ; end"
|
||||
assert t = Parfait::Space.object_space.get_class_by_name(:Testing) , "No classes created"
|
||||
assert_equal :Object , t.super_class_name
|
||||
end
|
||||
|
||||
def test_creates_class_with_deriviation
|
||||
Compiler.compile "class Test2 < List ;end"
|
||||
assert t = Parfait::Space.object_space.get_class_by_name(:Test2) , "No classes created"
|
||||
assert_equal :List , t.super_class_name
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user