Class: Minitest::Sound::Reporter
- Inherits:
-
StatisticsReporter
- Object
- StatisticsReporter
- Minitest::Sound::Reporter
- Defined in:
- lib/minitest/sound/reporter.rb
Instance Method Summary collapse
-
#add_defaults(defaults) ⇒ Object
When using the following methods together with
minitest-reporters, they are required. - #after_test(test) ⇒ Object
- #before_test(test) ⇒ Object
-
#initialize(io = $stdout, options = {}) ⇒ Reporter
constructor
A new instance of Reporter.
- #report ⇒ Object
- #start ⇒ Object
- #test_success? ⇒ Boolean
Constructor Details
#initialize(io = $stdout, options = {}) ⇒ Reporter
Returns a new instance of Reporter.
6 7 8 9 10 11 12 |
# File 'lib/minitest/sound/reporter.rb', line 6 def initialize(io = $stdout, = {}) super(io, ) @player = Minitest::Sound::Player.new( success: Minitest::Sound.success, failure: Minitest::Sound.failure, during_test: Minitest::Sound.during_test, ) end |
Instance Method Details
#add_defaults(defaults) ⇒ Object
When using the following methods together with minitest-reporters, they are required.
31 |
# File 'lib/minitest/sound/reporter.rb', line 31 def add_defaults(defaults); end |
#after_test(test) ⇒ Object
35 |
# File 'lib/minitest/sound/reporter.rb', line 35 def after_test(test); end |
#before_test(test) ⇒ Object
33 |
# File 'lib/minitest/sound/reporter.rb', line 33 def before_test(test); end |
#report ⇒ Object
19 20 21 22 23 |
# File 'lib/minitest/sound/reporter.rb', line 19 def report super @player.stop_during_test_sound test_success? ? @player.play_success_sound : @player.play_failure_sound end |
#start ⇒ Object
14 15 16 17 |
# File 'lib/minitest/sound/reporter.rb', line 14 def start super @player.play_during_test_sound end |
#test_success? ⇒ Boolean
25 26 27 |
# File 'lib/minitest/sound/reporter.rb', line 25 def test_success? errors == 0 && failures == 0 end |