minitest-growl 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 37eeecb768c379096f434f1ee69c3ddf35c7e4fb
4
+ data.tar.gz: 7dedd5a349aafc4066c63e503e69d7c8a72550d3
5
+ SHA512:
6
+ metadata.gz: 91c72e2c600ead190df5dcac1fc4d9e7267391ab718b22dead3eace5d17ac797111992bfb2b6ccc1c68ea6a396f978d2230a00f880c4064bf47e8f982964689f
7
+ data.tar.gz: b86ba1aab0983cb2d359115f9cadf7a1777c4c59c4f31a2e2718edb2b09bf1302ce33743ff39c4fe13f4d9cbb5db0a316ad2060ce6bc095ca8e63a8f8251de6c
@@ -0,0 +1,5 @@
1
+ /Gemfile.lock
2
+ /pkg/
3
+ /coverage/
4
+ .yardoc
5
+ doc
@@ -0,0 +1 @@
1
+ 2.4.1
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2017 Jonas Thiel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,53 @@
1
+ # minitest-growl
2
+
3
+ Test notifier for minitest via Growl.
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/minitest-growl.svg)](https://badge.fury.io/rb/minitest-growl)
6
+ [![Code Climate](https://codeclimate.com/github/jnbt/minitest-growl/badges/gpa.svg)](https://codeclimate.com/github/jnbt/minitest-growl)
7
+ [![Gemnasium](https://img.shields.io/gemnasium/jnbt/minitest-growl.svg?style=flat)](https://gemnasium.com/jnbt/minitest-growl)
8
+ [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg?style=flat)](http://www.rubydoc.info/github/jnbt/minitest-growl/master)
9
+
10
+ ## Installation
11
+
12
+ gem install minitest-growl
13
+
14
+ or when using [bundler](http://bundler.io)
15
+
16
+ gem 'minitest-growl'
17
+
18
+ ## Usage
19
+
20
+ Simply add `require 'minitest/growl_notify'` after `require 'minitest/autorun'`.
21
+
22
+ ```ruby
23
+ require 'minitest/autorun'
24
+ require 'minitest/growl_notify'
25
+
26
+ describe 'some tests' do
27
+ it 'failes' do
28
+ 'foo'.must_equal 'bar'
29
+ end
30
+ end
31
+ ```
32
+
33
+ ## Options
34
+
35
+ You may pass the host to receive the Growl notification via MiniTest's CLI:
36
+
37
+ ruby -Ilib:test test/minitest_growl_notify_test.rb --growl_notify my-machine.com
38
+
39
+
40
+ ## Dependencies
41
+
42
+ * [ruby-growl](https://github.com/drbrain/ruby-growl)
43
+ * [Growl](http://growl.info/)
44
+
45
+ ## Authors
46
+
47
+ * [Jonas Thiel](http://github.com/jnbt)
48
+
49
+ Initially inspired by: [minitest-libnotify](https://github.com/splattael/minitest-libnotify)
50
+
51
+ ## Copyright
52
+
53
+ Copyright © 2017 Jonas Thiel. See LICENSE.txt for details.
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rake/testtask'
4
+
5
+ Rake::TestTask.new(:spec) do |test|
6
+ test.test_files = FileList['test/**/*_test.rb']
7
+ test.libs << 'spec'
8
+ test.verbose = true
9
+ end
10
+
11
+ task default: %i(spec)
@@ -1,5 +1,6 @@
1
- require 'minitest/unit'
2
- require 'growl'
1
+ require 'minitest'
2
+ require 'minitest/growl_notify/reporter'
3
+ require 'minitest/growl_notify/version'
3
4
 
4
5
  module MiniTest
5
6
  # Test notifier for minitest via growl.
@@ -11,30 +12,6 @@ module MiniTest
11
12
  # require 'minitest/autorun'
12
13
  # require 'minitest/growl_notify'
13
14
  #
14
- class GrowlNotify
15
- VERSION = "0.0.3"
16
-
17
- def initialize io
18
- @io = io
19
- end
20
-
21
- def puts(*o)
22
- if o.first =~ /(\d+) failures, (\d+) errors/
23
- description = [ defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby", RUBY_VERSION, RUBY_PLATFORM ].join(" ")
24
- if $1.to_i > 0 || $2.to_i > 0 # fail?
25
- Growl.notify_error o.first, :title => ":-( #{description}"
26
- else
27
- Growl.notify_ok o.first, :title => ":-) #{description}"
28
- end
29
- else
30
- @io.puts(*o)
31
- end
32
- end
33
-
34
- def method_missing(msg, *args, &block)
35
- @io.send(msg, *args, &block)
36
- end
15
+ module GrowlNotify
37
16
  end
38
17
  end
39
-
40
- MiniTest::Unit.output = MiniTest::GrowlNotify.new(MiniTest::Unit.output)
@@ -0,0 +1,41 @@
1
+ require 'ruby-growl'
2
+
3
+ module MiniTest
4
+ module GrowlNotify
5
+ class Reporter < StatisticsReporter
6
+ def report
7
+ super
8
+ if passed?
9
+ growl.notify("notification", ":-) #{summary}", statistics)
10
+ else
11
+ growl.notify("failure", ":-( #{summary}", statistics)
12
+ end
13
+ end
14
+
15
+ private
16
+
17
+ def summary
18
+ '%d runs, %d failures, %d errors, %d skips' %
19
+ [count, failures, errors, skips]
20
+ end
21
+
22
+ def statistics # :nodoc:
23
+ '%d assertions, finished in %.2fs, %.2f runs/s, %.2f assertions/s.' %
24
+ [assertions, total_time, count / total_time, assertions / total_time]
25
+ end
26
+
27
+ def growl
28
+ @growl ||= begin
29
+ growl = Growl.new growl_host, 'MiniTest'
30
+ growl.add_notification 'notification', 'Notification'
31
+ growl.add_notification 'failure', 'Failure'
32
+ growl
33
+ end
34
+ end
35
+
36
+ def growl_host
37
+ options[:growl_notify_host] || 'localhost'
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,5 @@
1
+ module MiniTest
2
+ module GrowlNotify
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ require 'minitest'
2
+ require 'minitest/growl_notify'
3
+
4
+ module MiniTest
5
+ # This hook is automatically called from MiniTest's plugin system on start
6
+ def self.plugin_growl_notify_options(opts, options)
7
+ opts.on '--growl_notify HOST',
8
+ 'Report results to HOST Growl (default: "localhost")' do |host|
9
+ options[:growl_notify_host] = host
10
+ end
11
+ end
12
+
13
+ # This hook is automatically called from MiniTest's plugin system on run
14
+ def self.plugin_growl_notify_init(options)
15
+ self.reporter << MiniTest::GrowlNotify::Reporter.new(options[:io], options)
16
+ end
17
+ end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "minitest/growl_notify"
3
+ require "minitest/growl_notify/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "minitest-growl"
@@ -11,13 +11,11 @@ Gem::Specification.new do |s|
11
11
  s.summary = %q{Test notifier for minitest via growl.}
12
12
  s.description = %q{Display graphical notfications when testing with minitest.}
13
13
 
14
- s.rubyforge_project = "minitest-growl"
15
-
16
14
  s.files = `git ls-files`.split("\n")
17
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
17
  s.require_paths = ["lib"]
20
18
 
21
- s.add_runtime_dependency 'minitest'
22
- s.add_runtime_dependency 'growl'
19
+ s.add_dependency 'minitest', '~> 5.10'
20
+ s.add_dependency 'ruby-growl', '~> 4.1'
23
21
  end
@@ -0,0 +1,18 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/growl_notify'
3
+
4
+ describe 'fake tests' do
5
+ 100.times do |i|
6
+ it '100 must always be 100, test no. #{i}' do
7
+ 100.must_equal 100
8
+ end
9
+ end
10
+
11
+ it 'compares foo to bar' do
12
+ 'foo'.must_equal 'bar'
13
+ end
14
+
15
+ it 'skips tests' do
16
+ skip 'for later work'
17
+ end
18
+ end
metadata CHANGED
@@ -1,99 +1,85 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: minitest-growl
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 3
10
- version: 0.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Jonas Thiel
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-12-05 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2017-06-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.10'
23
20
  type: :runtime
24
- version_requirements: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
33
21
  prerelease: false
34
- requirement: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: growl
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-growl
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.1'
37
34
  type: :runtime
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
47
35
  prerelease: false
48
- requirement: *id002
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.1'
49
41
  description: Display graphical notfications when testing with minitest.
50
- email:
42
+ email:
51
43
  - jonasthiel+minitest-growl@googlemail.com
52
44
  executables: []
53
-
54
45
  extensions: []
55
-
56
46
  extra_rdoc_files: []
57
-
58
- files:
47
+ files:
48
+ - ".gitignore"
49
+ - ".ruby-version"
59
50
  - Gemfile
60
- - README.rdoc
51
+ - LICENSE.txt
52
+ - README.md
61
53
  - Rakefile
62
54
  - lib/minitest/growl_notify.rb
55
+ - lib/minitest/growl_notify/reporter.rb
56
+ - lib/minitest/growl_notify/version.rb
57
+ - lib/minitest/growl_notify_plugin.rb
63
58
  - minitest-growl.gemspec
64
- has_rdoc: true
59
+ - test/minitest_growl_notify_test.rb
65
60
  homepage: https://github.com/jnbt/minitest-growl
66
61
  licenses: []
67
-
62
+ metadata: {}
68
63
  post_install_message:
69
64
  rdoc_options: []
70
-
71
- require_paths:
65
+ require_paths:
72
66
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
76
69
  - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
80
- - 0
81
- version: "0"
82
- required_rubygems_version: !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
85
74
  - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
91
77
  requirements: []
92
-
93
- rubyforge_project: minitest-growl
94
- rubygems_version: 1.5.3
78
+ rubyforge_project:
79
+ rubygems_version: 2.6.11
95
80
  signing_key:
96
- specification_version: 3
81
+ specification_version: 4
97
82
  summary: Test notifier for minitest via growl.
98
- test_files: []
99
-
83
+ test_files:
84
+ - test/minitest_growl_notify_test.rb
85
+ has_rdoc:
@@ -1,29 +0,0 @@
1
- = minitest-growl
2
-
3
- Test notifier for minitest via Growl.
4
-
5
- Source[http://github.com/jnbt/minitest-growl] |
6
- RDoc[http://rdoc.info/github/jnbt/minitest-growl/master/file/README.rdoc]
7
-
8
- == Usage
9
-
10
- require 'minitest/autorun'
11
- require 'minitest/growl'
12
-
13
- == Installation
14
-
15
- gem install minitest-growl
16
-
17
- == Dependencies
18
-
19
- growl gem[https://github.com/visionmedia/growl]
20
- Growl[http://growl.info/]
21
- growlnotify[http://growl.info/extras.php#growlnotify]
22
-
23
- == Authors
24
-
25
- * Jonas Thiel (http://github.com/jnbt)
26
-
27
- == License
28
-
29
- MIT License[http://www.opensource.org/licenses/mit-license.php]