jasmine-headless-webkit/spec/javascripts/jasmine.HeadlessReporter.ConsoleBase_spec.coffee

36 lines
1.0 KiB
CoffeeScript
Raw Permalink Normal View History

2012-01-10 22:14:37 +00:00
describe 'jasmine.HeadlessReporter.ConsoleBase', ->
reporter = null
beforeEach ->
reporter = new jasmine.HeadlessReporter.ConsoleBase()
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./)