more prettifying, plus a JHW reporter

This commit is contained in:
John Bintz 2012-01-11 11:27:18 -05:00
parent 77d5a527f8
commit f9ec7cb8ea
2 changed files with 19 additions and 8 deletions

View File

@ -56,7 +56,7 @@ class jasmine.GWT.Scenario extends jasmine.GWT.Background
_this = this
describe @feature.name, ->
it scenarioName, ->
describe scenarioName, ->
jasmine.GWT.runHook('Before', _this)
for [ type, name, param ] in _statements
@ -64,13 +64,8 @@ class jasmine.GWT.Scenario extends jasmine.GWT.Background
_this._name = name
runCode = (param, args = []) ->
resultsIndex = jasmine.getEnv().currentSpec.results().getItems().length
param.apply(_this, args)
for index in [ resultsIndex...(jasmine.getEnv().currentSpec.results().getItems().length) ]
result = jasmine.getEnv().currentSpec.results().getItems()[index]
result.message = "[#{type} #{name}] " + result.message
it "#{type} #{name}", ->
param.apply(_this, args)
args = []

View File

@ -0,0 +1,16 @@
#= require jasmine.HeadlessReporter.Verbose
class jasmine.HeadlessReporter.VerboseGWT extends jasmine.HeadlessReporter.Verbose
colorLine: (line, color) =>
parts = line.split(' ')
type = parts.shift()
switch type
when 'Given'
type.foreground('yellow') + ' ' + parts.join(' ').foreground(color)
when 'When'
type.foreground('cyan') + ' ' + parts.join(' ').foreground(color)
when 'Then'
type.foreground('magenta') + ' ' + parts.join(' ').foreground(color)
else
line.foreground(color)