mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-08 09:34:22 +00:00
added additional Invoker test
This commit is contained in:
parent
c43be70678
commit
d4a556996a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user