Class: EmojifyRspecFormatter

Inherits:
RSpec::Core::Formatters::BaseTextFormatter
  • Object
show all
Defined in:
lib/emojify_rspec_formatter.rb

Instance Method Summary collapse

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