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

38 lines
1.1 KiB
CoffeeScript

describe 'HeadlessReporterResult', ->
describe 'jasmine.HeadlessConsoleReporter', ->
reporter = null
beforeEach ->
reporter = new jasmine.HeadlessConsoleReporter()
describe '#formatResultLine', ->
context 'length = 1', ->
it 'should format', ->
reporter.length = 1
expect(reporter.formatResultLine(0)).toMatch(/test,/)
context 'length != 1', ->
it 'should format', ->
reporter.length = 2
expect(reporter.formatResultLine(0)).toMatch(/tests,/)
context 'failedCount = 1', ->
it 'should format', ->
reporter.failedCount = 1
expect(reporter.formatResultLine(0)).toMatch(/failure,/)
context 'failedCount != 1', ->
it 'should format', ->
reporter.failedCount = 0
expect(reporter.formatResultLine(0)).toMatch(/failures,/)
context 'runtime = 1', ->
it 'should format', ->
expect(reporter.formatResultLine(1)).toMatch(/sec./)
context 'runtime != 1', ->
it 'should format', ->
expect(reporter.formatResultLine(0)).toMatch(/secs./)