2016-08-21 05:29:16 +00:00
|
|
|
lfs = require "lfs"
|
|
|
|
|
|
|
|
expose "fake LOVE 0.10.1", ->
|
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
_G.love = require "spec/love"
|
2016-08-21 05:29:16 +00:00
|
|
|
|
|
|
|
describe "Pop.Box", ->
|
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
--it "errors when require'd wrong", ->
|
|
|
|
-- assert.error -> require "init"
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
it "can be required by 'init'", ->
|
|
|
|
assert.has_no.errors -> require "init"
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
pending "errors if you use LOVE < 0.9.1", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.load", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
pending "loads all elements", ->
|
|
|
|
-- check they are in elements[name]
|
|
|
|
-- check specifics if able have used their load functions
|
|
|
|
-- if able, check that custom wraps have been called
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
pending "loads all skins", ->
|
|
|
|
-- see checks for loading all elements
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
pending "loads all extensions", ->
|
|
|
|
-- see checks for loading all elements
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
it "creates an element the size of the game window", ->
|
|
|
|
pop = require "init"
|
|
|
|
w, h = pop.screen\getSize!
|
|
|
|
assert.are.equal love.graphics.getWidth!, w
|
|
|
|
assert.are.equal love.graphics.getHeight!, h
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
pending "check inherit checker", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.create", ->
|
|
|
|
-- these need to check parent/child relations and data relations
|
|
|
|
pending "creates elements with pop.screen by default", ->
|
|
|
|
pending "creates elements with no parent when you pass false", ->
|
|
|
|
pending "creates elements with specified parent when passed an element", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.update", ->
|
|
|
|
pending "only updates when data.update is truthy", ->
|
|
|
|
pending "updates all children", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.draw", ->
|
|
|
|
pending "draws elements only when data.draw is truthy", ->
|
|
|
|
pending "draws all children", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.mousemoved", ->
|
|
|
|
pending "handles mousemoved events on a focused element", ->
|
|
|
|
--idk exactly how to make a unit test for this...
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.mousepressed", ->
|
|
|
|
pending "idk", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.mousereleased", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "click handling", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "mouserelease handling", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.keypressed", ->
|
|
|
|
pending "idk", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.keyreleased", ->
|
|
|
|
pending "idk", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.textinput", ->
|
|
|
|
pending "idk", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.debugDraw", ->
|
|
|
|
pending "idk", ->
|
2016-08-21 05:29:16 +00:00
|
|
|
|
2017-08-28 08:49:12 +00:00
|
|
|
describe "pop.printElementTree", ->
|
|
|
|
pending "idk", ->
|