     class Jax.Material.TestLayer extends Jax.Material.Layer
       setVariables: (context, mesh, model, vars, pass) -> return false
     matr = new Jax.Material
-    matr.addLayer new Jax.Material.TestLayer
+    matr.addLayer new Jax.Material.TestLayer {}, matr
     spyOn matr, 'drawBuffers'
     matr.render SPEC_CONTEXT, new Jax.Mesh.Triangles, new Jax.Model
     expect(matr.drawBuffers).not.toHaveBeenCalled()

    class Jax.Material.TestLayer extends Jax.Material.Layer
      setVariables: (context, mesh, model, vars, pass) -> return undefined
    matr = new Jax.Material
    matr.addLayer new Jax.Material.TestLayer
    spyOn matr, 'drawBuffers'
    matr.render SPEC_CONTEXT, new Jax.Mesh.Triangles, new Jax.Model
    expect(matr.drawBuffers).toHaveBeenCalled()

  it "should not skip passes where setVariables is not defined", ->
    class Jax.Material.TestLayer extends Jax.Material.Layer
    matr = new Jax.Material
    matr.addLayer new Jax.Material.TestLayer {}, matr
    spyOn matr, 'drawBuffers'
    matr.render SPEC_CONTEXT, new Jax.Mesh.Triangles, new Jax.Model
    expect(matr.drawBuffers).toHaveBeenCalled()
