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.
@@ -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
@@ -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