Skip to content

Instantly share code, notes, and snippets.

@nclark
Created May 31, 2010 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nclark/419709 to your computer and use it in GitHub Desktop.
Save nclark/419709 to your computer and use it in GitHub Desktop.

stole this off a blog post somewhere, i forget. makes your rake spec output like 900 times more PIMP.

--colour
--format UnicodeFormatter
--loadby mtime
--reverse
# Unicode formatter for RSpec console output
require 'spec/runner/formatter/base_text_formatter'
class UnicodeFormatter < Spec::Runner::Formatter::BaseTextFormatter
def example_failed(example, counter, failure)
@output.print colorize_failure('✗ ', failure)
@output.flush
end
def example_passed(example)
@output.print green('✓ ')
@output.flush
end
def example_pending(example, message)
super
@output.print yellow('● ')
@output.flush
end
def start_dump
@output.puts
@output.flush
end
def method_missing(sym, *args)
# ignore
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment