mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 16:17:57 -05:00
718e7ebd22
There was a misnamed variable, incorrect expect, and outdated calling style
26 lines
863 B
CoffeeScript
26 lines
863 B
CoffeeScript
describe('Path.createPath', ->
|
|
path = require 'lib/surface/path'
|
|
it('ignores the first point', ->
|
|
points = [[0,0], [1,1], [2,2]]
|
|
g = new createjs.Graphics()
|
|
g.lineTo = jasmine.createSpy('graphicz')
|
|
path.createPath(points, {tailColor:[100,100,100,0.0]}, g)
|
|
expect(g.lineTo.calls.length).toBe(1)
|
|
expect(g.lineTo.calls[0].args[0]).toBe(points[2])
|
|
)
|
|
|
|
# # BROKEN
|
|
xit('dots correctly', ->
|
|
points = ([x,x] for x in [0..30])
|
|
g = new createjs.Graphics()
|
|
calls = []
|
|
funcs = ['lineTo', 'moveTo', 'beginStroke', 'endStroke', 'setStrokeStyle']
|
|
for funcName in funcs
|
|
f = (funcName) => (args...) =>
|
|
calls.push("#{funcName}(#{args})")
|
|
g[funcName] = jasmine.createSpy('graphics').andCallFake(f(funcName))
|
|
path.createPath(points, {dotted:true}, g)
|
|
expect(g.beginStroke.calls.length).toBe(4)
|
|
)
|
|
)
|
|
|