bluepill-gearman 1.0.0 → 1.0.1
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.
- data/Changelog.md +3 -2
- data/Rakefile +3 -0
- data/lib/bluepill-gearman/version.rb +1 -1
- data/spec/bluepill-gearman_spec.rb +17 -16
- metadata +1 -1
data/Changelog.md
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# v1.0.1 - spec tests passing
|
2
|
+
# v1.0.0
|
3
|
+
* Initial release
|
data/Rakefile
CHANGED
@@ -17,24 +17,25 @@ describe Bluepill::Gearman::SendGearman do
|
|
17
17
|
it "should notify gearman_server of a critical error via send_gearman when a transition to down occurs" do
|
18
18
|
process.expect(:name, 'my_process')
|
19
19
|
transition = Minitest::Mock.new
|
20
|
-
transition.expect(:to_name
|
21
|
-
notifier.expects(:send_gearman).with({:
|
20
|
+
transition.expect(:to_name, :down)
|
21
|
+
notifier.expects(:send_gearman).with({:gearman_job_server => ['remotehost:4730'], :host => 'localhost', :service => 'my_process', :return_code => 2, :status => "Bluepill reported process down at #{Time.now}", :queue => 'check_results', :encryption => false, :key => '', :every => 1.minute})
|
22
22
|
notifier.notify(transition)
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
it "should notify gearman_server of a warning error via send_gearman when a transition to unmonitored occurs" do
|
26
|
+
process.expect(:name, 'my_process')
|
27
|
+
transition = Minitest::Mock.new
|
28
|
+
transition.expect(:to_name,:unmonitored)
|
29
|
+
notifier.expects(:send_gearman).with({:gearman_job_server => ['remotehost:4730'], :host => 'localhost', :service => 'my_process', :return_code => 1, :status => "Bluepill stopped monitoring at #{Time.now}", :queue => 'check_results', :encryption => false, :key => '', :every => 1.minute})
|
30
|
+
notifier.notify(transition)
|
31
|
+
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
it "should notify gearman_server that everything is ok via send_gearman when a transition to up occurs" do
|
34
|
+
process.expect(:name, 'my_process')
|
35
|
+
transition = Minitest::Mock.new
|
36
|
+
transition.expect(:to_name,:up)
|
37
|
+
notifier.expects(:send_gearman).with({:gearman_job_server => ['remotehost:4730'], :host => 'localhost', :service => 'my_process', :return_code => 0, :status => "Running", :queue => 'check_results', :encryption => false, :key => '', :every => 1.minute})
|
38
|
+
notifier.notify(transition)
|
39
|
+
end
|
40
|
+
|
40
41
|
end
|