Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Pretty formatter with output stream when autoformatting #599

Merged
merged 1 commit into from
Nov 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Initialize Pretty formatter with output stream when autoformatting
  • Loading branch information
jmcaffee committed Nov 15, 2013
commit 90b4ebfc90240db30549206a9a0fb1a7b655994b
23 changes: 23 additions & 0 deletions features/autoformat_profile_output.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Feature: Autoformat profile output

Background:
Given a file named "features/autoformat_output_has_profile_info.feature" with:
"""
Feature:

Scenario: Passing
Given passing
"""

Scenario: when using a profile the output should include 'Using the default profile...'
And a file named "cucumber.yml" with:
"""
default: -r features
"""
When I run `cucumber --profile default --autoformat tmp`
Then it should pass
And the output should contain:
"""
Using the default profile...
"""

2 changes: 1 addition & 1 deletion lib/cucumber/cli/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def formatters(runtime)
# can be done with the gherkin CLI.
if @options[:autoformat]
require 'cucumber/formatter/pretty'
return [Formatter::Pretty.new(runtime, nil, @options)]
return [Formatter::Pretty.new(runtime, out_stream, @options)]
end

@options[:formats].map do |format_and_out|
Expand Down