mirror of
https://github.com/kikito/middleclass.git
synced 2024-11-08 09:34:22 +00:00
class methods and attributes work. Object spec is nearly finished
This commit is contained in:
parent
0e637ea8da
commit
02f5f05b6a
@ -161,18 +161,16 @@ context('An instance method', function()
|
||||
|
||||
end)
|
||||
|
||||
context('A class attribute', function()
|
||||
|
||||
local A, B
|
||||
|
||||
--[[
|
||||
before(function()
|
||||
A = class('A')
|
||||
A.static.foo = 'foo'
|
||||
|
||||
|
||||
|
||||
|
||||
context('A class attribute', function()
|
||||
local A = class('A')
|
||||
A.foo = 'foo'
|
||||
|
||||
local B = class('B', A)
|
||||
B = class('B', A)
|
||||
end)
|
||||
|
||||
test('should be available after being initialized', function()
|
||||
assert_equal(A.foo, 'foo')
|
||||
@ -187,13 +185,19 @@ end)
|
||||
assert_equal(B.foo, 'chunky bacon')
|
||||
assert_equal(A.foo, 'foo')
|
||||
end)
|
||||
end)
|
||||
|
||||
context('A class method', function()
|
||||
local A = class('A')
|
||||
end)
|
||||
|
||||
context('A class method', function()
|
||||
|
||||
local A, B
|
||||
|
||||
before(function()
|
||||
A = class('A')
|
||||
function A.foo(theClass) return 'foo' end
|
||||
|
||||
local B = class('B', A)
|
||||
B = class('B', A)
|
||||
end)
|
||||
|
||||
test('should be available after being initialized', function()
|
||||
assert_equal(A:foo(), 'foo')
|
||||
@ -208,8 +212,10 @@ end)
|
||||
assert_equal(B:foo(), 'chunky bacon')
|
||||
assert_equal(A:foo(), 'foo')
|
||||
end)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
--[[
|
||||
context('A Mixin', function()
|
||||
|
||||
local Class1 = class('Class1')
|
||||
|
Loading…
Reference in New Issue
Block a user