mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-25 02:44:20 +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()
|
||||
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user