Created
June 21, 2011 01:59
-
-
Save spicycode/1037079 to your computer and use it in GitHub Desktop.
Revisions
-
spicycode created this gist
Jun 21, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ 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 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ require 'rspec/core/formatters/documentation_formatter' class YellyTheYellingistFormatter < RSpec::Core::Formatters::DocumentationFormatter def example_passed(example) dabble_in_that_which_should_not_be_dabbled('yes!', example) super(example) shout!('yes!', example) end def example_failed(example) dabble_in_that_which_should_not_be_dabbled('no!', example) super(example) shout!('no!', example) end def example_pending(example) dabble_in_that_which_should_not_be_dabbled('meh', example) super(example) shout!('meh', example) end private def dabble_in_that_which_should_not_be_dabbled(say_what_now, example) example.metadata[:description] = "#{say_what_now.upcase} - #{example.metadata[:description]}" end def shout!(say_what_now, example) 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