removing meta class (for now)

This commit is contained in:
Torsten Ruger
2016-12-29 18:39:59 +02:00
parent 80237e5033
commit 4c3007e6c0
5 changed files with 1 additions and 120 deletions

View File

@ -4,7 +4,6 @@ require_relative "test_dictionary"
require_relative "test_named_list"
require_relative "test_list"
require_relative "test_message"
require_relative "test_meta_class"
require_relative "test_typed_method"
require_relative "test_object"
require_relative "test_space"

View File

@ -1,55 +0,0 @@
require_relative "../helper"
class TestMeta < MiniTest::Test
def setup
@space = Register.machine.boot.space
@try = @space.create_class(:Try , :Object).meta
end
def foo_method for_class = :Try
args = Parfait::Type.for_hash( @try , { bar: :Integer})
::Parfait::TypedMethod.new @space.get_class_by_name(for_class).instance_type , :foo , args
end
def test_meta
assert @try.name
end
def test_meta_object
assert @space.get_class_by_name(:Object).meta
end
def test_no_methods
assert_equal 0 , @try.method_names.get_length
end
def test_meta_methods
assert @try.methods
end
def test_add_method
foo = foo_method
assert_equal foo , @try.add_instance_method(foo)
assert_equal 1 , @try.method_names.get_length
assert_equal ":foo" , @try.method_names.inspect
end
def test_remove_method
test_add_method
assert_equal true , @try.remove_instance_method(:foo)
end
def test_remove_nothere
assert_raises RuntimeError do
@try.remove_instance_method(:foo)
end
end
def test_method_get
test_add_method
assert_equal Parfait::TypedMethod , @try.get_instance_method(:foo).class
end
def test_method_get_nothere
assert_nil @try.get_instance_method(:foo)
test_remove_method
assert_nil @try.get_instance_method(:foo)
end
end