minitest-sound 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 894c94793c5fcbe9bacbf6950e9e4363f2da6873
4
- data.tar.gz: 2f7b12b4319b47d053ee188f20cb19f7e6d788fb
3
+ metadata.gz: b9117041ce681a354ee81040cfa8ff9e58dfd1e4
4
+ data.tar.gz: b3197e6f6630d57c2fac58e21b21659d18b910d4
5
5
  SHA512:
6
- metadata.gz: ded6eef4e7cb497ca7aa17f59a3ec659524fcf96fc3f06180ef81030860d872c5280e1703fb4f0a71ec9a4ddea523ff1e6e714d86446fd7c190f8d412fbc3800
7
- data.tar.gz: 54492f502f6bffe6e052ea6107dba43655e43df84e02a4ad90484c8f57d0f36939c8e7b7480850acf35e4c0b7c62e5fde03f47437aa08abd4accbf37315962ff
6
+ metadata.gz: f8e969fe2936f89620e51833e85a4200bdb250a84c3a313e2785c2206231962e160cd63216d3573037d7b8f23092120d7abfd53930b7bdea80b854be2fecd962
7
+ data.tar.gz: eaf46a9db0e563dc27acf61770224f96d8c81bd8ac797e04548e2f6f93d02c252c88d86c677f6eac9619ac5630fddf86890064035bfe42287650bf962cac7415
@@ -19,11 +19,15 @@ module Minitest
19
19
  def report
20
20
  super
21
21
  @player.stop_during_test_sound
22
- (errors == 0 && failures == 0) ? @player.play_success_sound : @player.play_failure_sound
22
+ test_success? ? @player.play_success_sound : @player.play_failure_sound
23
+ end
24
+
25
+ def test_success?
26
+ errors == 0 && failures == 0
23
27
  end
24
28
 
25
29
 
26
- # When using the following methods together with xxx, they are required.
30
+ # When using the following methods together with `minitest-reporters`, they are required.
27
31
  def add_defaults(defaults); end
28
32
 
29
33
  def before_test(test); end
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Sound
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -12,9 +12,8 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = "https://github.com/y-yagi/minitest-sound"
13
13
  spec.license = "MIT"
14
14
 
15
- spec.files = `git ls-files -z`.split("\x0")
15
+ spec.files = %w(LICENSE.txt README.md minitest-sound.gemspec) + Dir['lib/**/*.rb']
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
17
  spec.require_paths = ["lib"]
19
18
 
20
19
  spec.add_dependency 'minitest', '>= 5.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-sound
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Yaginuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -73,22 +73,14 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - ".gitignore"
77
- - Gemfile
78
76
  - LICENSE.txt
79
77
  - README.md
80
- - Rakefile
81
78
  - lib/minitest/sound.rb
82
79
  - lib/minitest/sound/player.rb
83
80
  - lib/minitest/sound/reporter.rb
84
81
  - lib/minitest/sound/version.rb
85
82
  - lib/minitest/sound_plugin.rb
86
83
  - minitest-sound.gemspec
87
- - test/fixtures/during_test.mp3
88
- - test/fixtures/failure.mp3
89
- - test/fixtures/success.mp3
90
- - test/player_test.rb
91
- - test/test_helper.rb
92
84
  homepage: https://github.com/y-yagi/minitest-sound
93
85
  licenses:
94
86
  - MIT
@@ -113,10 +105,4 @@ rubygems_version: 2.2.2
113
105
  signing_key:
114
106
  specification_version: 4
115
107
  summary: Play a sound when test finished
116
- test_files:
117
- - test/fixtures/during_test.mp3
118
- - test/fixtures/failure.mp3
119
- - test/fixtures/success.mp3
120
- - test/player_test.rb
121
- - test/test_helper.rb
122
- has_rdoc:
108
+ test_files: []
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in minitest-sound.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- task :default => :test
5
- Rake::TestTask.new do |t|
6
- t.pattern = "test/**/*_test.rb"
7
- t.verbose = true
8
- end
Binary file
Binary file
Binary file
data/test/player_test.rb DELETED
@@ -1,60 +0,0 @@
1
- require_relative 'test_helper'
2
- require 'sys/proctable'
3
- include Sys
4
-
5
- module MinitestSoundTest
6
- class PlayerTest < MiniTest::Test
7
- def setup
8
- @fixtures_directory = File.expand_path('../fixtures', __FILE__)
9
- end
10
-
11
- def test_do_nothing_when_unset_success
12
- player = Minitest::Sound::Player.new
13
- player.play_success_sound
14
- assert_equal(false, play_sound?)
15
- end
16
-
17
- def test_play_success_sound_when_set_success
18
- success_sound = File.join(@fixtures_directory, 'success.mp3')
19
- player = Minitest::Sound::Player.new(success: success_sound)
20
- pid = player.play_success_sound(false)
21
- assert_equal(true, play_sound?(success_sound))
22
- Process.kill('SIGINT', pid)
23
- end
24
-
25
- def test_do_nothing_when_unset_failure
26
- player = Minitest::Sound::Player.new
27
- player.play_failure_sound
28
- assert_equal(false, play_sound?)
29
- end
30
-
31
- def test_play_failure_sound_when_set_faiure
32
- failure_sound = File.join(@fixtures_directory, 'failure.mp3')
33
- player = Minitest::Sound::Player.new(failure: failure_sound)
34
- pid = player.play_failure_sound(false)
35
- assert_equal(true, play_sound?(failure_sound))
36
- Process.kill('SIGINT', pid)
37
- end
38
-
39
- def test_output_errmsg_when_donot_install_mpg123
40
- original_path = ENV['PATH']
41
- ENV['PATH'] = ''
42
-
43
- success_sound = File.join(@fixtures_directory, 'success.mp3')
44
- player = Minitest::Sound::Player.new(success: success_sound)
45
-
46
- out, err = capture_io { player.play_success_sound }
47
- assert_equal(%Q(warning: minitest-sound use "mpg123". Please install "mpg123".\n), err)
48
- ensure
49
- ENV['PATH'] = original_path
50
- end
51
-
52
- private
53
- def play_sound?(file = nil)
54
- processes = ProcTable.ps.select{|s| s.comm == 'mpg123'}
55
- return false if processes.empty?
56
-
57
- processes.any?{|p| p.cmdline == "mpg123 #{file}"}
58
- end
59
- end
60
- end
data/test/test_helper.rb DELETED
@@ -1,5 +0,0 @@
1
- require 'minitest/autorun'
2
- require 'minitest/mock'
3
- require 'minitest/sound'
4
- require 'minitest/sound/player'
5
- require 'minitest/sound/reporter'