From 8c53b4ab67cfd0b9d4b74976b90b8e72e4d1be7f Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 18 Mar 2018 22:37:43 +0530 Subject: [PATCH] fix more api ripples from typed method --- test/parfait/test_typed_method.rb | 5 ++--- test/parfait/type/test_method_api.rb | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/parfait/test_typed_method.rb b/test/parfait/test_typed_method.rb index 818ba35c..90da3e9d 100644 --- a/test/parfait/test_typed_method.rb +++ b/test/parfait/test_typed_method.rb @@ -5,9 +5,8 @@ class TestMethod < MiniTest::Test def setup obj = Parfait.object_space.get_class_by_name(:Object).instance_type args = Parfait::Type.for_hash( obj.object_class , { bar: :Integer , foo: :Type}) - @method = ::Parfait::TypedMethod.new obj , :meth , args - @method.add_local :local_bar , :Integer - @method.add_local :local_foo , :Type + frame = Parfait::Type.for_hash( obj.object_class , { local_bar: :Integer , local_foo: :Type}) + @method = Parfait::TypedMethod.new( obj , :meth , args , frame) end def test_method_name diff --git a/test/parfait/type/test_method_api.rb b/test/parfait/type/test_method_api.rb index 2d9446a4..aa79684d 100644 --- a/test/parfait/type/test_method_api.rb +++ b/test/parfait/type/test_method_api.rb @@ -9,9 +9,12 @@ class TestMethodApi < MiniTest::Test @try_type = @try_class.instance_type end + def empty_frame + Parfait::Type.for_hash( @try_class , { }) + end def foo_method( for_class = :Try) args = Parfait::Type.for_hash( @try_class , { bar: :Integer}) - ::Parfait::TypedMethod.new @space.get_class_by_name(for_class).instance_type , :foo , args + ::Parfait::TypedMethod.new( @space.get_class_by_name(for_class).instance_type , :foo , args,empty_frame) end def add_foo_to( clazz = :Try ) foo = foo_method( clazz ) @@ -42,7 +45,7 @@ class TestMethodApi < MiniTest::Test end def test_create_method args = Parfait::Type.for_hash( @try_class , { bar: :Integer}) - @try_type.create_method :bar, args + @try_type.create_method :bar, args , empty_frame assert @try_type.method_names.inspect.include?("bar") end def test_method_get