added additional Invoker test

This commit is contained in:
kikito 2010-09-20 23:42:27 +02:00
parent c43be70678
commit d4a556996a

View File

@ -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)