lib/cucumber/formatter/console.rb in cucumber-0.6.2 vs lib/cucumber/formatter/console.rb in cucumber-0.6.3

- old
+ new

@@ -66,11 +66,11 @@ @failures = step_mother.scenarios(:failed).select { |s| s.is_a?(Cucumber::Ast::Scenario) } if !@failures.empty? @io.puts format_string("Failing Scenarios:", :failed) @failures.each do |failure| - profiles_string = (profiles.map{|profile| "-p #{profile} " }).flatten unless profiles.empty? + profiles_string = profiles.empty? ? '' : (profiles.map{|profile| "-p #{profile}" }).join(' ') + ' ' @io.puts format_string("cucumber #{profiles_string}" + failure.file_colon_line, :failed) + format_string(" # Scenario: " + failure.name, :comment) end @io.puts end @@ -143,12 +143,14 @@ #activate this feature def announce(announcement) if @delayed_announcements @delayed_announcements << announcement else - @io.puts - @io.puts(format_string(announcement, :tag)) - @io.flush + if @io + @io.puts + @io.puts(format_string(announcement, :tag)) + @io.flush + end end end def print_announcements() @delayed_announcements.each {|ann| print_announcement(ann)}