Skip to content

Instantly share code, notes, and snippets.

@seenmyfate
Forked from curiositycasualty/README.md
Last active August 29, 2015 14:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seenmyfate/548a1f2e7220ce509745 to your computer and use it in GitHub Desktop.
Save seenmyfate/548a1f2e7220ce509745 to your computer and use it in GitHub Desktop.

YELLY!!!!! THE YELLINGIST FORMATTER EVER!!!!!

Yelly likes to yell. To make the magic happen for simple cases just invoke him ala:

bundle exec rspec --require=yelly_the_yellingist_formatter.rb --format=YellyTheYellingistFormatter spec/models/your_file_here_spec.rb

In closing, >:O

Updated to Rspec 3.0's formatter interface.


This fork edited to say the failure aloud, mainly so I don't have to be resizing Tmux panes to read failure messages when working on a smaller screen.

require 'rspec/core/formatters/documentation_formatter'
class YellyTheYellingistFormatter < RSpec::Core::Formatters::DocumentationFormatter
RSpec::Core::Formatters.register self, :example_failed
def initialize(*args)
super
end
def example_failed(notification)
super
shout! "Failure - #{notification.exception}"
end
private
def shout!(say_what_now)
return unless you_got_the_pipes?
system("say", say_what_now)
end
def you_got_the_pipes?
@pipes_present ||= system('which say > /dev/null')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment