Skip to content

Instantly share code, notes, and snippets.

@jeffkreeftmeijer
Created November 14, 2010 23:25
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffkreeftmeijer/676219 to your computer and use it in GitHub Desktop.
Save jeffkreeftmeijer/676219 to your computer and use it in GitHub Desktop.
A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

FffuuuFormatter

A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

Installation

Throw it in a file and run your specs like this:

$ rspec -r path/to/fffuuu_formatter.rb -f FffuuuFormatter spec/

If you want to use this as your default formatter, put this into your .rspec file:

-r path/to/fffuuu_formatter.rb
  -f FffuuuFormatter
require 'rspec/core/formatters/progress_formatter'
class FffuuuFormatter < RSpec::Core::Formatters::ProgressFormatter
def example_failed(example)
@failed_examples << example
letter = (@example_count / 2 >= @failed_examples.count) ? 'F' : 'U'
output.print red(letter)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment