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

Conversation

jmcaffee
Copy link
Contributor

System: Win 7 Ultimate x64
Console: MsysGit (bash)
Ruby: ruby 1.9.3p392 (2013-02-22) [i386-mingw32]

Does NOT occur before v1.3.0. Tested on 1.2.5, 1.3.0, 1.3.9.

c:/opt/bin/Ruby193/bin/ruby -S bundle exec cucumber features/blah/blagh.feature -a tmp/pretty
private method `puts' called for nil:NilClass (NoMethodError)
c:/opt/bin/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.9/lib/cucumber/formatter/console.rb:202:in `print_profile_information'

From what I can see, nil is passed (as the IO object) to Formatter::Pretty.new when autoformat is used (in Configuration#formatters).
The crash happens when @IO.puts is called with @IO == nil.

The workaround I've found is to specify the --no-profile (-P) flag when using --autoformat. If there's no profile, print_profile_information exits early and puts is not called.

@ghost ghost assigned os97673 Nov 15, 2013
@os97673 os97673 merged commit 90b4ebf into cucumber:v1.3.x-bugfix Nov 16, 2013
@os97673
Copy link
Member

os97673 commented Nov 16, 2013

Thank you for fixing the problem.

@jmcaffee jmcaffee deleted the autoformat-issue branch November 16, 2013 19:15
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants