Class: EmojifyRspecFormatter
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- EmojifyRspecFormatter
- Defined in:
- lib/emojify_rspec_formatter.rb
Instance Method Summary collapse
- #example_failed(failed) ⇒ Object
- #example_passed(passed) ⇒ Object
-
#initialize(output) ⇒ EmojifyRspecFormatter
constructor
A new instance of EmojifyRspecFormatter.
Constructor Details
#initialize(output) ⇒ EmojifyRspecFormatter
Returns a new instance of EmojifyRspecFormatter.
8 9 10 |
# File 'lib/emojify_rspec_formatter.rb', line 8 def initialize(output) @output = output end |
Instance Method Details
#example_failed(failed) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/emojify_rspec_formatter.rb', line 12 def example_failed(failed) @output.print (['😨 ', '😵 ', '🙅 ', '🆘 ', '👎 ', '💔 ', '😭 ', '💩 ', '😐 ', '📉 ', '😱 ', '🙊 '].sample).colorize(:background => :red) puts (failed.example.description.strip).colorize(:color => :red) end |
#example_passed(passed) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/emojify_rspec_formatter.rb', line 20 def example_passed(passed) @output.print (['🍺 ','🙌 ','😍 ', '🆒 ','👌 ','💘 ', '💯 ','🔥 ','😎 ', '📈 ','💪 ','💎 ', '💅 ','💋 ','👑 ', '🎀 ','🎉 ','🎈 '].sample).colorize(:background => :green) puts (passed.example.description.strip).colorize(:color => :green) end |