Class: MiniTest::Libnotify
- Inherits:
-
Object
- Object
- MiniTest::Libnotify
- Defined in:
- lib/minitest/libnotify.rb,
lib/minitest/libnotify/version.rb
Overview
Test notifier for minitest via libnotify.
Usage
In your test helper put:
require 'minitest/autorun'
require 'minitest/libnotify'
Config
require 'minitest/autorun'
require 'minitest/libnotify'
reporter = MiniTest::Unit.output
reporter.config[:global][:description] = "TESTS"
reporter.config[:pass][:description] = proc { |desc| "#{desc} :)" }
reporter.config[:fail][:description] = proc { |desc| "#{desc} :(" }
reporter.config[:fail][:icon_path] = "face-crying.*"
Constant Summary collapse
- VERSION =
"0.2.2"
Class Attribute Summary collapse
-
.default_config ⇒ Object
Returns the value of attribute default_config.
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(io, config = self.class.default_config) ⇒ Libnotify
constructor
A new instance of Libnotify.
- #method_missing(msg, *args, &block) ⇒ Object
- #puts(*o) ⇒ Object
- #respond_to?(msg) ⇒ Boolean
Constructor Details
#initialize(io, config = self.class.default_config) ⇒ Libnotify
Returns a new instance of Libnotify.
52 53 54 55 56 |
# File 'lib/minitest/libnotify.rb', line 52 def initialize(io, config = self.class.default_config) @io = io @libnotify = nil @config = config.dup end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(msg, *args, &block) ⇒ Object
63 64 65 |
# File 'lib/minitest/libnotify.rb', line 63 def method_missing(msg, *args, &block) @io.send(msg, *args, &block) end |
Class Attribute Details
.default_config ⇒ Object
Returns the value of attribute default_config.
27 28 29 |
# File 'lib/minitest/libnotify.rb', line 27 def default_config @default_config end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
50 51 52 |
# File 'lib/minitest/libnotify.rb', line 50 def config @config end |
Instance Method Details
#puts(*o) ⇒ Object
58 59 60 61 |
# File 'lib/minitest/libnotify.rb', line 58 def puts(*o) notify(o.first) if libnotify @io.puts(*o) end |
#respond_to?(msg) ⇒ Boolean
67 68 69 |
# File 'lib/minitest/libnotify.rb', line 67 def respond_to?(msg) @io.respond_to?(msg) || super end |