Module: Minitest

Defined in:
lib/minitest/emoji_plugin.rb

Defined Under Namespace

Classes: Emoji

Class Method Summary collapse

Class Method Details

.plugin_emoji_init(options) ⇒ Object

:nodoc:



21
22
23
24
25
26
27
28
29
# File 'lib/minitest/emoji_plugin.rb', line 21

def self.plugin_emoji_init options # :nodoc:
  if Emoji.emoji? then
    io = Emoji.new options[:io]

    self.reporter.reporters.grep(Minitest::Reporter).each do |rep|
      rep.io = io
    end
  end
end

.plugin_emoji_options(opts, options) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/minitest/emoji_plugin.rb', line 5

def self.plugin_emoji_options opts, options # :nodoc:
  opts.on "-e", "--emoji", "Show Emoji instead of dots" do
    Emoji.emoji!
  end

  opts.on "-t", "--theme [name]", "Pick an emoji theme" do |name|
    unless name
      puts "Choose from these themes:"
      Emoji.themes.keys.each{|theme| puts "  #{theme}" }
      puts "...or, 'random' for a random theme"
      exit 1
    end
    Emoji.theme! name
  end
end