Skip to content

Commit

Permalink
Add (currently empty) global and testcase specific <system-out/> and …
Browse files Browse the repository at this point in the history
…<system-err/> tags
  • Loading branch information
R. Tyler Croy committed Apr 24, 2012
1 parent 3197955 commit 143d2b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cucumber/formatter/junit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def after_feature(feature)
:time => "%.6f" % @time,
:name => @feature_name ) do
@testsuite << @builder.target!
@testsuite.tag!('system-out')
@testsuite.tag!('system-err')
end

write_file(feature_result_filename(feature.file), @testsuite.target!)
Expand Down Expand Up @@ -131,6 +133,8 @@ def build_testcase(duration, status, exception = nil, suffix = "")
@builder.skipped
@skipped += 1
end
@builder.tag!('system-out')
@builder.tag!('system-err')
end
@tests += 1
end
Expand Down
16 changes: 16 additions & 0 deletions spec/cucumber/formatter/junit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ def write_file(feature_filename, data)
FEATURE

it { @doc.to_s.should =~ /One passing scenario, one failing scenario/ }

it 'should have a root system-out node' do
@doc.xpath('//testsuite/system-out').size.should == 1
end

it 'should have a root system-err node' do
@doc.xpath('//testsuite/system-err').size.should == 1
end

it 'should have a system-out node under <testcase/>' do
@doc.xpath('//testcase/system-out').size.should == 1
end

it 'should have a system-err node under <testcase/>' do
@doc.xpath('//testcase/system-err').size.should == 1
end
end

describe "with a scenario in a subdirectory" do
Expand Down

0 comments on commit 143d2b8

Please sign in to comment.