I’m using Jasmine with CoffeeScript (in Rails 3.1) and test_track. Everything else is fine, but I cant have spyOn on function calls to work:
describe "spyOn", ->
it "should spy", ->
foo =
bar: ->
spyOn(foo, 'bar')
foo.bar()
expect(foo.bar).toHaveBeenCalled()
the expect fails. What’s wrong?
Update: the same exact code works on tryjasmine. It could be a bug with the version of jasmine with test_track.
For those who got the same problem, here’s the answer:
https://github.com/quickleft/test_track/issues/7#issuecomment-2570580