checking classes don't get created twice
This commit is contained in:
parent
83f2459a8a
commit
fc96f1d2da
@ -50,7 +50,9 @@ module Melon
|
|||||||
|
|
||||||
def get_name( statement )
|
def get_name( statement )
|
||||||
return nil unless statement
|
return nil unless statement
|
||||||
statement.children[1]
|
name = statement.children[1]
|
||||||
|
raise "Not symbol #{name}" unless name.is_a? Symbol
|
||||||
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -7,6 +7,13 @@ module Melon
|
|||||||
Register.machine.boot
|
Register.machine.boot
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_doesnt_create_existing_clas
|
||||||
|
space_class = Parfait.object_space.get_class_by_name(:Space)
|
||||||
|
RubyCompiler.compile "class Space ; end"
|
||||||
|
clazz = Parfait.object_space.get_class_by_name(:Space)
|
||||||
|
assert_equal clazz , space_class
|
||||||
|
end
|
||||||
|
|
||||||
def test_creates_class_without_deriviation
|
def test_creates_class_without_deriviation
|
||||||
RubyCompiler.compile "class Testing ; end"
|
RubyCompiler.compile "class Testing ; end"
|
||||||
clazz = Parfait.object_space.get_class_by_name(:Testing)
|
clazz = Parfait.object_space.get_class_by_name(:Testing)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user