From d4a556996a52fc7dc74f8599a5e7644fd1f1d8d6 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 20 Sep 2010 23:42:27 +0200 Subject: [PATCH] added additional Invoker test --- spec/Invoker_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/Invoker_spec.lua b/spec/Invoker_spec.lua index 44cf967..781bf01 100644 --- a/spec/Invoker_spec.lua +++ b/spec/Invoker_spec.lua @@ -5,6 +5,7 @@ context( 'Invoker', function() local MyClass = class('MyClass') MyClass:include(Invoker) function MyClass:foo(x,y) return 'foo ' .. tostring(x) .. ', ' .. tostring(y) end + function MyClass:testSelf() return instanceOf(MyClass, self) end local obj = MyClass:new() @@ -22,5 +23,10 @@ context( 'Invoker', function() 'bar 3, 4' ) end) + + test('It should use self as implicit parameter in all cases', function() + assert_true(obj:invoke('testSelf')) + assert_true(obj:invoke(MyClass.testSelf)) + end) end)