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()
@ -23,4 +24,9 @@ context( 'Invoker', function()
)
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)