-
-
Save rubiii/1036525 to your computer and use it in GitHub Desktop.
Revisions
-
rubiii revised this gist
Jun 20, 2011 . 1 changed file with 1 addition and 1 deletion.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 @@ -5,7 +5,7 @@ Get your fortune now! Let all your specs pass and the next fortune will appear. h1. Usage bc. $ rspec -r ./fortune_formatter.rb -f FortuneFormatter spec h1. Notes -
blackhacker revised this gist
Jun 20, 2011 . 1 changed file with 1 addition and 3 deletions.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 @@ -5,9 +5,7 @@ Get your fortune now! Let all your specs pass and the next fortune will appear. h1. Usage bc. $ rspec -r ./fortune_formatter.rb -f FortuneFormatter h1. Notes -
blackhacker revised this gist
Jun 20, 2011 . 1 changed file with 11 additions and 0 deletions.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 @@ -1,3 +1,14 @@ h1. FortuneFormatter Get your fortune now! Let all your specs pass and the next fortune will appear. h1. Usage {noformat} rspec -r ./fortune_formatter.rb -f FortuneFormatter {noformat} h1. Notes * Doesn´t work very well with webmock :-) -
blackhacker revised this gist
Jun 20, 2011 . 1 changed file with 3 additions and 0 deletions.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,3 @@ h1. FortuneFormatter Get your fortune now! Let all your specs pass and the next fortune will appear. -
Thilko Richter revised this gist
Jun 20, 2011 . No changes.There are no files selected for viewing
-
Thilko Richter created this gist
Jun 20, 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,20 @@ require 'rspec/core/formatters/progress_formatter' require "net/http" class FortuneFormatter < RSpec::Core::Formatters::ProgressFormatter def stop super print_fortune if all_passed? end def all_passed? failure_count == 0 && pending_count == 0 end def print_fortune response = Net::HTTP.start("brenocon.com") { |connect| connect.get "/fortune.cgi" } message "\n<====FORTUNE=============>" message response.body.scan(/<PRE>.(.*).?<\/PRE>/im).flatten.first.chomp message "<========================>" end end