Class: Minitest::Growler
- Inherits:
-
StatisticsReporter
- Object
- StatisticsReporter
- Minitest::Growler
- Defined in:
- lib/minitest/growler_plugin.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
Instance Method Summary collapse
- #image_path(type) ⇒ Object
-
#initialize(options) ⇒ Growler
constructor
A new instance of Growler.
- #notify(message, image_type) ⇒ Object
- #report ⇒ Object
Constructor Details
#initialize(options) ⇒ Growler
Returns a new instance of Growler.
26 27 28 |
# File 'lib/minitest/growler_plugin.rb', line 26 def initialize() super end |
Class Method Details
.growler! ⇒ Object
18 19 20 |
# File 'lib/minitest/growler_plugin.rb', line 18 def self.growler! @growler = true end |
.growler? ⇒ Boolean
22 23 24 |
# File 'lib/minitest/growler_plugin.rb', line 22 def self.growler? @growler ||= false end |
Instance Method Details
#image_path(type) ⇒ Object
44 45 46 |
# File 'lib/minitest/growler_plugin.rb', line 44 def image_path(type) File.join(File.(File.dirname(__FILE__)), 'images', "#{type}.png") end |
#notify(message, image_type) ⇒ Object
40 41 42 |
# File 'lib/minitest/growler_plugin.rb', line 40 def notify(, image_type) Growl.notify(, :image => image_path(image_type)) end |
#report ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/minitest/growler_plugin.rb', line 30 def report super if failures.to_i > 0 || errors.to_i > 0 notify("Tests Failed! (#{failures.to_i} failures, #{errors.to_i} errors)", :failure) else notify("Tests Passed! (#{assertions.to_i} assertions)", :success) end end |