jasmine-headless-webkit/spec/javascripts/jasmine.HeadlessReporter_spec.coffee
2011-12-12 12:22:32 -05:00

28 lines
766 B
CoffeeScript

describe 'jasmine.HeadlessReporter', ->
reporter = null
beforeEach ->
reporter = new jasmine.HeadlessReporter()
it 'should stop running specs if there are errors reported', ->
# otherwise it gets really confusing!
suite = { finish: -> null }
spec = new jasmine.Spec("env", suite, "test")
spyOn(reporter, 'hasError').andReturn(true)
spyOn(spec, 'finish')
spyOn(suite, 'finish')
reporter.reportSpecStarting(spec)
expect(spec.finish).toHaveBeenCalled()
expect(suite.finish).toHaveBeenCalled()
describe '#reportRunnerStarting', ->
it 'should start getting time', ->
expect(reporter.startTime).not.toBeDefined()
reporter.reportRunnerStarting("runner")
expect(reporter.startTime).toBeDefined()