test_notifier 2.0.3 → 3.0.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.
- checksums.yaml +5 -5
- data/.gitignore +3 -1
- data/.rubocop.yml +13 -0
- data/Gemfile +3 -1
- data/README.md +58 -0
- data/Rakefile +16 -2
- data/lib/minitest/test_notifier_plugin.rb +7 -0
- data/lib/test_notifier/runner/minitest.rb +59 -10
- data/lib/test_notifier/runner/rspec.rb +47 -5
- data/lib/test_notifier/runner.rb +3 -2
- data/lib/test_notifier/stats.rb +32 -54
- data/lib/test_notifier/version.rb +5 -3
- data/lib/test_notifier.rb +37 -25
- data/resources/error.png +0 -0
- data/resources/fail.png +0 -0
- data/resources/success.png +0 -0
- data/test/fixtures/minitest_sample_test.rb +30 -0
- data/test/fixtures/rspec_sample_spec.rb +27 -0
- data/test/test_helper.rb +18 -0
- data/test/test_notifier/stats_minitest_test.rb +45 -0
- data/test/test_notifier/stats_rspec_test.rb +37 -0
- data/test/test_notifier_test.rb +96 -0
- data/test_notifier.gemspec +20 -14
- metadata +80 -41
- data/.rspec +0 -1
- data/Gemfile.lock +0 -32
- data/README.rdoc +0 -74
- data/lib/test_notifier/runner/autotest.rb +0 -36
- data/lib/test_notifier/runner/rspec2.rb +0 -29
- data/lib/test_notifier/runner/rspec3.rb +0 -35
- data/lib/test_notifier/runner/spec.rb +0 -21
- data/lib/test_notifier/runner/test_unit.rb +0 -29
- data/resources/register-growl.scpt +0 -0
- data/spec/spec_helper.rb +0 -13
- data/spec/stats/minitest_spec.rb +0 -26
- data/spec/stats/rspec1_spec.rb +0 -25
- data/spec/stats/rspec_spec.rb +0 -30
- data/spec/stats/test_unit_spec.rb +0 -25
- data/spec/test_notifier_spec.rb +0 -51
data/spec/stats/rspec_spec.rb
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe TestNotifier::Stats, "RSpec" do
|
|
4
|
-
subject(:stats) { TestNotifier::Stats.new(:rspec) }
|
|
5
|
-
|
|
6
|
-
it "returns success message" do
|
|
7
|
-
stats.options = { :count => 10 }
|
|
8
|
-
expect(stats.message).to eql("10 examples")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it "returns message with failing examples" do
|
|
12
|
-
stats.options = { :count => 10, :failures => 5 }
|
|
13
|
-
expect(stats.message).to eql("10 examples, 5 failed")
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it "returns message with pending examples" do
|
|
17
|
-
stats.options = { :count => 10, :pending => 5 }
|
|
18
|
-
expect(stats.message).to eql("10 examples, 5 pending")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns message with error examples" do
|
|
22
|
-
stats.options = { :count => 10, :failures => 5, :errors => 5 }
|
|
23
|
-
expect(stats.message).to eql("10 examples, 5 failed, 5 errors")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "returns message with all types" do
|
|
27
|
-
stats.options = { :count => 6, :failures => 3, :errors => 2, :pending => 3 }
|
|
28
|
-
expect(stats.message).to eql("6 examples, 3 failed, 3 pending, 2 errors")
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe TestNotifier::Stats, "TestUnit" do
|
|
4
|
-
subject(:stats) { TestNotifier::Stats.new(:test_unit) }
|
|
5
|
-
|
|
6
|
-
it "returns success message" do
|
|
7
|
-
stats.options = { :count => 10, :assertions => 20 }
|
|
8
|
-
expect(stats.message).to eql("10 tests, 20 assertions")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it "returns message with failing examples" do
|
|
12
|
-
stats.options = { :count => 10, :assertions => 20, :failures => 5 }
|
|
13
|
-
expect(stats.message).to eql("10 tests, 20 assertions, 5 failed")
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it "message with error examples" do
|
|
17
|
-
stats.options = { :count => 10, :assertions => 20, :errors => 5 }
|
|
18
|
-
expect(stats.message).to eql("10 tests, 20 assertions, 5 errors")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "message with all types" do
|
|
22
|
-
stats.options = { :count => 6, :failures => 2, :errors => 3, :assertions => 20 }
|
|
23
|
-
expect(stats.message).to eql("6 tests, 20 assertions, 2 failed, 3 errors")
|
|
24
|
-
end
|
|
25
|
-
end
|
data/spec/test_notifier_spec.rb
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe TestNotifier do
|
|
4
|
-
before { unsupport_all_notifiers }
|
|
5
|
-
|
|
6
|
-
it "uses default notifier" do
|
|
7
|
-
allow(Notifier::Growl).to receive(:supported?).and_return(true)
|
|
8
|
-
allow(Notifier::Snarl).to receive(:supported?).and_return(true)
|
|
9
|
-
TestNotifier.default_notifier = :snarl
|
|
10
|
-
|
|
11
|
-
expect(TestNotifier.notifier).to eql(Notifier::Snarl)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it "outputs error message to $stderr when there's no supported notifier" do
|
|
15
|
-
expect(STDERR).to receive(:<<).with(TestNotifier::NO_NOTIFIERS_MESSAGE)
|
|
16
|
-
expect(Notifier::Placebo).to receive(:notify)
|
|
17
|
-
|
|
18
|
-
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "outputs error message won't display when silence_no_notifier_warning is true" do
|
|
22
|
-
TestNotifier.silence_no_notifier_warning = true
|
|
23
|
-
|
|
24
|
-
expect(STDERR).not_to receive(:<<)
|
|
25
|
-
expect(Notifier::Placebo).to receive(:notify)
|
|
26
|
-
|
|
27
|
-
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it "outputs error message won't display when silence_no_notifier_warning is true" do
|
|
31
|
-
TestNotifier.silence_no_notifier_warning = true
|
|
32
|
-
|
|
33
|
-
expect(STDERR).not_to receive(:<<)
|
|
34
|
-
expect(Notifier::Placebo).to receive(:notify)
|
|
35
|
-
|
|
36
|
-
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
it "sends notification to supported notifier" do
|
|
40
|
-
allow(Notifier::Snarl).to receive(:supported?).and_return(true)
|
|
41
|
-
expect(Notifier::Snarl).to receive(:notify).with({
|
|
42
|
-
:status => :fail,
|
|
43
|
-
:message => "You have failed!",
|
|
44
|
-
:title => TestNotifier::TITLES[:fail],
|
|
45
|
-
:image => TestNotifier::IMAGES[:fail],
|
|
46
|
-
:color => TestNotifier::COLORS[:fail]
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
TestNotifier.notify :status => :fail, :message => "You have failed!"
|
|
50
|
-
end
|
|
51
|
-
end
|