Skip to content

Commit

Permalink
one more split-output test:
Browse files Browse the repository at this point in the history
  • Loading branch information
twcamper committed Jun 28, 2011
1 parent cde64c7 commit 58946e9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 20 additions & 11 deletions features/split_output.feature
@@ -1,15 +1,6 @@
@teardown @html
Feature: output a report in multiple formats

Scenario: two formats but one output file
Given output directory "tmp"
When I run cuporter --i fixtures/self_test --no-number --no-total --no-show-files --no-show-tags -f html -f text -o tmp/tags.html
Then the output should have the same contents as "features/reports/pretty_with_outlines_and_examples.txt"
But file "tmp/tags.txt" should not exist

When I read file "tmp/tags.html"
Then it should have ".tag" nodes

Scenario: four formats four output files all exist
Given output directory "tmp"
When I run cuporter -f html -f csv -f text -f xml -o tmp/tags.csv -o tmp/tags.txt -o tmp/tags.xml -o tmp/tags.html
Expand All @@ -21,7 +12,25 @@ Feature: output a report in multiple formats
And it should end with "</xml>"

Then file "tmp/tags.txt" should exist
And it should end with "output file"
And it should end with "is ignored"

Then file "tmp/tags.csv" should exist
And it should end with "output file,"
And it should end with "is ignored,"

Scenario: format with no matching output file goes to stdout
Given output directory "tmp"
When I run cuporter --i fixtures/self_test --no-number --no-total --no-show-files --no-show-tags -f html -f text -o tmp/tags.html
Then the output should have the same contents as "features/reports/pretty_with_outlines_and_examples.txt"
But file "tmp/tags.txt" should not exist

When I read file "tmp/tags.html"
Then it should have ".tag" nodes

Scenario: output file with no matching format is ignored
Given output directory "tmp"
When I run cuporter --i fixtures/self_test -f csv -f xml -o tmp/tags.html -o tmp/tags.xml
Then the output should end with "@wip,"
But file "tmp/tags.html" should not exist
And file "tmp/tags.csv" should not exist
But file "tmp/tags.xml" should exist

2 changes: 1 addition & 1 deletion features/step_definitions/cuporter_steps.rb
Expand Up @@ -81,7 +81,7 @@
our_nodes.should_not be_empty
end

Then /^it should end with "([^\"]+)"$/ do |expected_tail|
Then /^(?:it|the output) should end with "([^\"]+)"$/ do |expected_tail|
@output.should =~ /#{expected_tail}$/
end

0 comments on commit 58946e9

Please sign in to comment.