get the reporters working better and add features

This commit is contained in:
John Bintz 2012-01-03 12:28:17 -05:00
parent 489da3041d
commit ca86a577d8
12 changed files with 68 additions and 0 deletions

2
.gitignore vendored
View File

@ -15,3 +15,5 @@ spec/reports
test/tmp
test/version_tmp
tmp
.jhw-cache/

View File

@ -2,3 +2,7 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in jasmine-headless-webkit-reporters.gemspec
gemspec
gem 'jasmine-headless-webkit', :path => '../jasmine-headless-webkit'
gem 'cucumber'
gem 'rspec'

6
features/junit.feature Normal file
View File

@ -0,0 +1,6 @@
Feature: JUnit Reporter
Scenario:
Given I want to use the "JUnit" reporter
When I run the test suite
Then it should succeed

View File

@ -0,0 +1,4 @@
Given /^I want to use the "([^"]*)" reporter$/ do |reporter|
@reporter = reporter
end

View File

@ -0,0 +1,3 @@
Then /^it should succeed$/ do
$?.exitstatus.should == 0
end

View File

@ -0,0 +1,3 @@
When /^I run the test suite$/ do
%x{jasmine-headless-webkit -f #{@reporter}}
end

View File

@ -0,0 +1,6 @@
Feature: Teamcity Reporter
Scenario:
Given I want to use the "Teamcity" reporter
When I run the test suite
Then it should succeed

View File

@ -0,0 +1,7 @@
describe 'Super Long Test', ->
for index in [1..10000]
describe "run #{index}", ->
it 'should succeed', ->
for check in [1..100]
expect(check).toEqual(check)

View File

@ -0,0 +1,9 @@
src_dir: 'src'
spec_dir: 'spec/javascripts'
src_files:
- "*.js"
spec_files:
- "*_spec.*{js,coffee}"

0
src/test.js Normal file
View File

View File

@ -6,3 +6,15 @@ class jasmine.HeadlessReporter.JUnit extends jasmine.JUnitXmlReporter
writeFile: (filename, text) =>
JHW.print(@outputTarget, text)
reportSpecResults: (spec) =>
JHW.ping()
super(spec)
reportRunnerResults: (runner) =>
super(runner)
JHW.finishSuite()
if window.JHW
window.onbeforeunload = null

View File

@ -6,3 +6,15 @@ class jasmine.HeadlessReporter.Teamcity extends jasmine.TeamcityReporter
log: (text) =>
JHW.print(@outputTarget, text + "\n")
reportSpecResults: (spec) =>
JHW.ping()
super(spec)
reportRunnerResults: (runner) =>
super(runner)
JHW.finishSuite()
if window.JHW
window.onbeforeunload = null