cucumber/cucumber — pull request #599 by jmcaffee (2013-11-15 06:35:28+00:00)
Title: Initialize Pretty formatter with output stream when autoformatting

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.