2016-12-18 16:02:55 +01:00
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Melon
|
|
|
|
class TestClass < MiniTest::Test
|
|
|
|
|
2016-12-18 16:17:58 +01:00
|
|
|
def setup
|
|
|
|
Register.machine.boot unless Register.machine.booted
|
|
|
|
end
|
2016-12-18 19:05:11 +01:00
|
|
|
|
2016-12-18 16:17:58 +01:00
|
|
|
def test_creates_class_without_deriviation
|
|
|
|
Compiler.compile "class Testing ; end"
|
2016-12-30 13:10:49 +01:00
|
|
|
assert t = Parfait.object_space.get_class_by_name(:Testing) , "No classes created"
|
2016-12-18 16:17:58 +01:00
|
|
|
assert_equal :Object , t.super_class_name
|
2016-12-18 16:02:55 +01:00
|
|
|
end
|
2016-12-18 16:17:58 +01:00
|
|
|
|
|
|
|
def test_creates_class_with_deriviation
|
2016-12-20 14:46:23 +01:00
|
|
|
Compiler.compile "class Test2 < List ;end"
|
2016-12-30 13:10:49 +01:00
|
|
|
assert t = Parfait.object_space.get_class_by_name(:Test2) , "No classes created"
|
2016-12-18 16:17:58 +01:00
|
|
|
assert_equal :List , t.super_class_name
|
|
|
|
end
|
|
|
|
|
2016-12-18 16:02:55 +01:00
|
|
|
end
|
|
|
|
end
|