shouldertap 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.travis.yml +11 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +33 -0
- data/LICENSE.txt +22 -0
- data/README.md +65 -0
- data/Rakefile +3 -0
- data/bin/shouldertap +6 -0
- data/doc/assets/shouldertap-failed.png +0 -0
- data/doc/assets/shouldertap-passed-custom-name.png +0 -0
- data/doc/assets/shouldertap-passed.png +0 -0
- data/lib/shouldertap/cli.rb +44 -0
- data/lib/shouldertap/notification.rb +43 -0
- data/lib/shouldertap/resources/dialog-error.png +0 -0
- data/lib/shouldertap/resources/dialog-information.png +0 -0
- data/lib/shouldertap/resources/dialog-question.png +0 -0
- data/lib/shouldertap/resources/dialog-warning.png +0 -0
- data/lib/shouldertap/test.rb +32 -0
- data/lib/shouldertap/testsuite.rb +53 -0
- data/lib/shouldertap/version.rb +3 -0
- data/shouldertap.gemspec +26 -0
- data/spec/shouldertap/cli_spec.rb +45 -0
- data/spec/shouldertap/notification_spec.rb +47 -0
- data/spec/shouldertap/test_spec.rb +40 -0
- data/spec/shouldertap/testsuite_spec.rb +63 -0
- data/spec/spec_helper.rb +1 -0
- metadata +134 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1740819d2d08afff3bb94be8afc2c5839c7f46bb
|
4
|
+
data.tar.gz: a17ba1b2455024e4931478f5e6355aed30db9feb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 634501df32217504032e74cf39da0100629939a08c5d66912bc38a02b3d88d9f32d2674de7e7ec911b402b70ba4e20988ab87989700e581f733c3ba3ab09fb01
|
7
|
+
data.tar.gz: f1f0d26ab679d0fea9a2c3becc63f61c612783365cebf64276773a194449c640e4cd888abed129dc0c4e19e22ff1a55a2d98c74553d1c662309994bebb73ff64
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
shouldertap (0.0.1)
|
5
|
+
notify
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
diff-lcs (1.2.5)
|
11
|
+
notify (0.5.2)
|
12
|
+
rake (10.3.2)
|
13
|
+
rspec (3.1.0)
|
14
|
+
rspec-core (~> 3.1.0)
|
15
|
+
rspec-expectations (~> 3.1.0)
|
16
|
+
rspec-mocks (~> 3.1.0)
|
17
|
+
rspec-core (3.1.1)
|
18
|
+
rspec-support (~> 3.1.0)
|
19
|
+
rspec-expectations (3.1.0)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.1.0)
|
22
|
+
rspec-mocks (3.1.0)
|
23
|
+
rspec-support (~> 3.1.0)
|
24
|
+
rspec-support (3.1.0)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
bundler (~> 1.6)
|
31
|
+
rake
|
32
|
+
rspec
|
33
|
+
shouldertap!
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Ryan Doyle
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
ShoulderTap gives desktop notifications from the output of [TAP](http://testanything.org/) (Test Anything Protocol)
|
2
|
+
|
3
|
+
## Example
|
4
|
+
|
5
|
+
Using [Bats](https://github.com/sstephenson/bats) as a TAP Producer, we pipe its output into ShoulderTap
|
6
|
+
|
7
|
+
bats test.bats | shouldertap
|
8
|
+
|
9
|
+
![](https://github.com/ryandoyle/shouldertap/blob/master/doc/assets/shouldertap-passed.png)
|
10
|
+
|
11
|
+
And for failing tests:
|
12
|
+
|
13
|
+
bats failing.bats | shouldertap
|
14
|
+
|
15
|
+
![](https://github.com/ryandoyle/shouldertap/blob/master/doc/assets/shouldertap-failed.png)
|
16
|
+
|
17
|
+
ShoulderTap also supports changing the name of the notification with the `-n` switch
|
18
|
+
|
19
|
+
bats tests.bats | shouldertap -n 'My Project'
|
20
|
+
|
21
|
+
![](https://github.com/ryandoyle/shouldertap/blob/master/doc/assets/shouldertap-passed-custom-name.png)
|
22
|
+
|
23
|
+
There are a bunch of other producers available at the [Test Anything website](http://testanything.org/producers.html)
|
24
|
+
|
25
|
+
## Advanced Usage
|
26
|
+
|
27
|
+
With some simple shell scripting, we can run tests every time we save changes to our code. Here we are using [Bacon](https://github.com/chneukirchen/bacon) as our test harness.
|
28
|
+
|
29
|
+
while true; do
|
30
|
+
find . | xargs -- inotifywait --event modify
|
31
|
+
bacon --tap tests/* | shouldertap
|
32
|
+
done
|
33
|
+
|
34
|
+
## Installation
|
35
|
+
|
36
|
+
gem install shouldertap
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
Please fork and issue a pull request.
|
41
|
+
|
42
|
+
## License
|
43
|
+
|
44
|
+
Copyright (c) 2014 Ryan Doyle
|
45
|
+
|
46
|
+
MIT License
|
47
|
+
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
49
|
+
a copy of this software and associated documentation files (the
|
50
|
+
"Software"), to deal in the Software without restriction, including
|
51
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
52
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
53
|
+
permit persons to whom the Software is furnished to do so, subject to
|
54
|
+
the following conditions:
|
55
|
+
|
56
|
+
The above copyright notice and this permission notice shall be
|
57
|
+
included in all copies or substantial portions of the Software.
|
58
|
+
|
59
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
60
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
61
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
62
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
63
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
64
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
65
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
data/bin/shouldertap
ADDED
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
require 'shouldertap/testsuite'
|
4
|
+
require 'shouldertap/notification'
|
5
|
+
|
6
|
+
module ShoulderTap
|
7
|
+
class CLI
|
8
|
+
|
9
|
+
def initialize(arguments, tap_output)
|
10
|
+
@arguments = arguments
|
11
|
+
@tap_output = tap_output
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
testsuite = ShoulderTap::Testsuite.new @tap_output
|
16
|
+
ShoulderTap::Notification.new(testsuite, options[:name]).send
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def options
|
22
|
+
@options ||= parse_options
|
23
|
+
end
|
24
|
+
|
25
|
+
def parse_options
|
26
|
+
options = {}
|
27
|
+
parser = OptionParser.new do |opts|
|
28
|
+
opts.banner = "Usage: shouldertap [-h] [-r NAME] < TAP_OUTPUT"
|
29
|
+
opts.on '-h', '--help', 'Print help' do
|
30
|
+
STDERR.puts opts
|
31
|
+
exit 1
|
32
|
+
end
|
33
|
+
opts.on '-n', '--name NAME', 'Name of the test that ShoulderTap will report as. Defaults to "ShoulderTap"' do |n|
|
34
|
+
options[:name] = n
|
35
|
+
end
|
36
|
+
end
|
37
|
+
parser.parse! @arguments
|
38
|
+
options
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'notify'
|
2
|
+
|
3
|
+
module ShoulderTap
|
4
|
+
class Notification
|
5
|
+
|
6
|
+
SUCCESS_ICON = "dialog-information.png"
|
7
|
+
FAILURE_ICON = "dialog-error.png"
|
8
|
+
DEFAULT_SENDER = 'ShoulderTap'
|
9
|
+
|
10
|
+
def initialize(testsuite, sender = nil)
|
11
|
+
@testsuite = testsuite
|
12
|
+
@sender = sender.nil? ? DEFAULT_SENDER : sender
|
13
|
+
end
|
14
|
+
|
15
|
+
def send
|
16
|
+
Notify.notify title, message, :app_name => 'ShoulderTap', :icon => icon
|
17
|
+
end
|
18
|
+
|
19
|
+
def title
|
20
|
+
@sender + " - " + (@testsuite.success? ? "Passed" : "Failed")
|
21
|
+
end
|
22
|
+
|
23
|
+
def message
|
24
|
+
success_ratio + ' tests passed'
|
25
|
+
end
|
26
|
+
|
27
|
+
def icon
|
28
|
+
resources + (@testsuite.success? ? SUCCESS_ICON : FAILURE_ICON)
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def success_ratio
|
34
|
+
"#{@testsuite.success_count}/#{@testsuite.size}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def resources
|
38
|
+
File.dirname(__FILE__) + '/resources/'
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module ShoulderTap
|
2
|
+
|
3
|
+
class Test
|
4
|
+
|
5
|
+
def initialize(tap_line)
|
6
|
+
@tap_line = tap_line
|
7
|
+
parse_tap_line
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_reader :number, :message
|
11
|
+
|
12
|
+
def success?
|
13
|
+
@success
|
14
|
+
end
|
15
|
+
|
16
|
+
def failed?
|
17
|
+
! @success
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def parse_tap_line
|
23
|
+
@success = @tap_line[/^ok \d/] ? true : false
|
24
|
+
@number = @tap_line[/ok (\d)/,1].to_i
|
25
|
+
@message = @tap_line[/ok \d (.*)/, 1]
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'shouldertap/test'
|
2
|
+
|
3
|
+
module ShoulderTap
|
4
|
+
class Testsuite
|
5
|
+
|
6
|
+
def initialize(tap_output)
|
7
|
+
@tap_output = tap_output
|
8
|
+
end
|
9
|
+
|
10
|
+
def failed?
|
11
|
+
result.any? {|test| test.failed? }
|
12
|
+
end
|
13
|
+
|
14
|
+
def success?
|
15
|
+
! failed?
|
16
|
+
end
|
17
|
+
|
18
|
+
def result
|
19
|
+
@result ||= parse_tap
|
20
|
+
end
|
21
|
+
|
22
|
+
def size
|
23
|
+
result.size
|
24
|
+
end
|
25
|
+
|
26
|
+
def failures
|
27
|
+
result.select { |test| test.failed? }
|
28
|
+
end
|
29
|
+
|
30
|
+
def failed_count
|
31
|
+
failures.size
|
32
|
+
end
|
33
|
+
|
34
|
+
def successes
|
35
|
+
result.select { |test| test.success? }
|
36
|
+
end
|
37
|
+
|
38
|
+
def success_count
|
39
|
+
successes.size
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def parse_tap
|
45
|
+
@tap_output.each_line.collect do |line|
|
46
|
+
if line[/^ok/] or line[/^not ok/]
|
47
|
+
Test.new line
|
48
|
+
end
|
49
|
+
end.compact
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
data/shouldertap.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'shouldertap/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "shouldertap"
|
8
|
+
spec.version = ShoulderTap::VERSION
|
9
|
+
spec.authors = ["Ryan Doyle"]
|
10
|
+
spec.email = ["ryan@doylenet.net"]
|
11
|
+
spec.summary = %q{Get desktop notifications of builds fed by TAP output (Test Anything Protocol)}
|
12
|
+
spec.description = %q{ShoulderTap receives TAP-compliant (http://testanything.org/) output via STDIN and will display pop-up notifications once the test is complete}
|
13
|
+
spec.homepage = "https://github.com/ryandoyle/shouldertap"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "notify"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'shouldertap/cli'
|
4
|
+
|
5
|
+
describe ShoulderTap::CLI do
|
6
|
+
|
7
|
+
let(:options) { ['--help', '--name', 'foops'] }
|
8
|
+
let(:tap_output) { "foops" }
|
9
|
+
let(:notification) { double('notification' ) }
|
10
|
+
let(:testsuite) { double('testsuite') }
|
11
|
+
|
12
|
+
before do
|
13
|
+
allow(ShoulderTap::Testsuite).to receive(:new).and_return testsuite
|
14
|
+
allow(ShoulderTap::Notification).to receive(:new).and_return notification
|
15
|
+
allow(notification).to receive(:send)
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#run' do
|
19
|
+
it 'exits when --help is passed' do
|
20
|
+
cli = new_cli_with '--help'
|
21
|
+
allow(STDERR).to receive(:puts)
|
22
|
+
expect(cli).to receive(:exit).with 1
|
23
|
+
cli.run
|
24
|
+
end
|
25
|
+
describe '--name' do
|
26
|
+
it 'runs shouldertap with the name if present' do
|
27
|
+
cli = new_cli_with '--name foops'
|
28
|
+
expect(ShoulderTap::Notification).to receive(:new).with(testsuite, 'foops')
|
29
|
+
cli.run
|
30
|
+
end
|
31
|
+
it 'runs shouldertap with the default name if absent' do
|
32
|
+
cli = new_cli_with ''
|
33
|
+
expect(ShoulderTap::Notification).to receive(:new).with(testsuite, nil)
|
34
|
+
cli.run
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def new_cli_with(args)
|
41
|
+
described_class.new(args.split(" "),tap_output)
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'shouldertap/notification'
|
4
|
+
|
5
|
+
describe ShoulderTap::Notification do
|
6
|
+
|
7
|
+
|
8
|
+
let(:test_suite) { double('test_suite') }
|
9
|
+
let(:notification) { described_class.new test_suite }
|
10
|
+
|
11
|
+
|
12
|
+
describe '#title' do
|
13
|
+
it 'is a successful message if there were no failures' do
|
14
|
+
allow(test_suite).to receive(:success?).and_return true
|
15
|
+
expect(notification.title).to eql 'ShoulderTap - Passed'
|
16
|
+
end
|
17
|
+
it 'is a failing message if there were failures' do
|
18
|
+
allow(test_suite).to receive(:success?).and_return false
|
19
|
+
expect(notification.title).to eql 'ShoulderTap - Failed'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#message' do
|
24
|
+
it 'displays the amount of successful tests' do
|
25
|
+
allow(test_suite).to receive(:success_count).and_return 3
|
26
|
+
allow(test_suite).to receive(:size).and_return 6
|
27
|
+
expect(notification.message).to eql '3/6 tests passed'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#icon' do
|
32
|
+
|
33
|
+
before do
|
34
|
+
allow(File).to receive(:dirname).and_return '/dir'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'is the success icon when the testsuite is successful' do
|
38
|
+
allow(test_suite).to receive(:success?).and_return true
|
39
|
+
expect(notification.icon).to eql '/dir/resources/dialog-information.png'
|
40
|
+
end
|
41
|
+
it 'is the error icon when the testsuite has failure' do
|
42
|
+
allow(test_suite).to receive(:success?).and_return false
|
43
|
+
expect(notification.icon).to eql '/dir/resources/dialog-error.png'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'shouldertap/test'
|
4
|
+
|
5
|
+
describe ShoulderTap::Test do
|
6
|
+
|
7
|
+
let(:test) { described_class.new 'ok 3 testing foo bats' }
|
8
|
+
|
9
|
+
describe '#success?' do
|
10
|
+
|
11
|
+
let(:failing_test) { described_class.new "not ok 2 true should equal false" }
|
12
|
+
|
13
|
+
it 'is true for a successful test' do
|
14
|
+
expect(test.success?).to eql true
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'is false for a failed test' do
|
18
|
+
expect(failing_test.success?).to eql false
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
describe '#number' do
|
25
|
+
it 'is the number of the test' do
|
26
|
+
expect(test.number).to eql 3
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'message' do
|
31
|
+
it 'is the extra message that goes with the test' do
|
32
|
+
expect(test.message).to eql 'testing foo bats'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'shouldertap/testsuite'
|
4
|
+
|
5
|
+
describe ShoulderTap::Testsuite do
|
6
|
+
|
7
|
+
|
8
|
+
let(:failing_output) { "1..4\n" +
|
9
|
+
"ok 1 testing foo bats\n" +
|
10
|
+
"not ok 2 the exit code: defaults to 0\n" +
|
11
|
+
"# (in test file /home/ryan/code/stubish/stub.bats, line 12)\n" +
|
12
|
+
"ok 3 stubbing a command to give an exit code of 1 returns 1 when the stub is called\n" +
|
13
|
+
"ok 4 stubbing returns an error when the stubbing arguments do not match\n"
|
14
|
+
}
|
15
|
+
let(:successful_output) { "1..3\n" +
|
16
|
+
"ok 1 testing foo bats\n" +
|
17
|
+
"ok 2 stubbing a command to give an exit code of 1 returns 1 when the stub is called\n" +
|
18
|
+
"ok 3 stubbing returns an error when the stubbing arguments do not match\n"
|
19
|
+
}
|
20
|
+
let(:nothing_output) { "someoutput that has no tests" }
|
21
|
+
|
22
|
+
let(:successful_test) { ShoulderTap::Testsuite.new successful_output }
|
23
|
+
let(:failing_test) { ShoulderTap::Testsuite.new failing_output }
|
24
|
+
let(:nothing_test) { ShoulderTap::Testsuite.new nothing_output }
|
25
|
+
|
26
|
+
describe '#success?' do
|
27
|
+
|
28
|
+
it 'is true if all the tests passed' do
|
29
|
+
expect(successful_test.success?).to eql true
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'is false if any tests failed' do
|
33
|
+
expect(failing_test.success?).to eql false
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'is true if there are no tests' do
|
37
|
+
expect(nothing_test.success?).to eql true
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#size' do
|
43
|
+
it 'is a count of the number of tests that ran' do
|
44
|
+
expect(failing_test.size).to eql 4
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#failed_count' do
|
49
|
+
it 'is the number of failed tests' do
|
50
|
+
expect(failing_test.failed_count).to eql 1
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#success_count' do
|
55
|
+
it 'is the number of successful tests' do
|
56
|
+
expect(failing_test.success_count).to eql 3
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
$:.unshift File.expand_path(File.dirname(__FILE__) + '../')
|
metadata
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: shouldertap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Doyle
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: notify
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: ShoulderTap receives TAP-compliant (http://testanything.org/) output
|
70
|
+
via STDIN and will display pop-up notifications once the test is complete
|
71
|
+
email:
|
72
|
+
- ryan@doylenet.net
|
73
|
+
executables:
|
74
|
+
- shouldertap
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".gitignore"
|
79
|
+
- ".travis.yml"
|
80
|
+
- Gemfile
|
81
|
+
- Gemfile.lock
|
82
|
+
- LICENSE.txt
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- bin/shouldertap
|
86
|
+
- doc/assets/shouldertap-failed.png
|
87
|
+
- doc/assets/shouldertap-passed-custom-name.png
|
88
|
+
- doc/assets/shouldertap-passed.png
|
89
|
+
- lib/shouldertap/cli.rb
|
90
|
+
- lib/shouldertap/notification.rb
|
91
|
+
- lib/shouldertap/resources/dialog-error.png
|
92
|
+
- lib/shouldertap/resources/dialog-information.png
|
93
|
+
- lib/shouldertap/resources/dialog-question.png
|
94
|
+
- lib/shouldertap/resources/dialog-warning.png
|
95
|
+
- lib/shouldertap/test.rb
|
96
|
+
- lib/shouldertap/testsuite.rb
|
97
|
+
- lib/shouldertap/version.rb
|
98
|
+
- shouldertap.gemspec
|
99
|
+
- spec/shouldertap/cli_spec.rb
|
100
|
+
- spec/shouldertap/notification_spec.rb
|
101
|
+
- spec/shouldertap/test_spec.rb
|
102
|
+
- spec/shouldertap/testsuite_spec.rb
|
103
|
+
- spec/spec_helper.rb
|
104
|
+
homepage: https://github.com/ryandoyle/shouldertap
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.2.2
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Get desktop notifications of builds fed by TAP output (Test Anything Protocol)
|
128
|
+
test_files:
|
129
|
+
- spec/shouldertap/cli_spec.rb
|
130
|
+
- spec/shouldertap/notification_spec.rb
|
131
|
+
- spec/shouldertap/test_spec.rb
|
132
|
+
- spec/shouldertap/testsuite_spec.rb
|
133
|
+
- spec/spec_helper.rb
|
134
|
+
has_rdoc:
|