spec/javascripts/jasmine.headless-reporter_spec.coffee in jasmine-headless-webkit-0.6.1 vs spec/javascripts/jasmine.headless-reporter_spec.coffee in jasmine-headless-webkit-0.6.2
- old
+ new
@@ -12,5 +12,27 @@
result = new HeadlessReporterResult('test', [ 'name', 'of', 'test' ])
expect(result._findSpecLine().lineNumber).toEqual(3)
result = new HeadlessReporterResult('test', [ 'other', 'of', 'test' ])
expect(result._findSpecLine().lineNumber).toEqual(10)
+
+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()
+