eye 0.2.4 → 0.3

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.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -3
  3. data/bin/eye +7 -0
  4. data/bin/loader_eye +7 -5
  5. data/examples/notify.eye +1 -1
  6. data/eye.gemspec +4 -4
  7. data/lib/eye.rb +1 -3
  8. data/lib/eye/controller.rb +4 -0
  9. data/lib/eye/controller/status.rb +1 -1
  10. data/lib/eye/dsl.rb +1 -1
  11. data/lib/eye/dsl/main.rb +0 -13
  12. data/lib/eye/dsl/opts.rb +4 -2
  13. data/lib/eye/loader.rb +2 -3
  14. data/lib/eye/notify.rb +3 -3
  15. data/lib/eye/process/monitor.rb +5 -3
  16. data/lib/eye/process/notify.rb +5 -5
  17. data/lib/eye/process/scheduler.rb +4 -4
  18. data/lib/eye/process/system.rb +3 -10
  19. data/lib/eye/process/trigger.rb +1 -1
  20. data/lib/eye/process/watchers.rb +1 -1
  21. data/lib/eye/server.rb +9 -8
  22. data/lib/eye/system.rb +2 -7
  23. data/lib/eye/system_resources.rb +3 -3
  24. data/lib/eye/utils/celluloid_chain.rb +2 -2
  25. metadata +7 -241
  26. data/lib/eye/io/unix_server.rb +0 -44
  27. data/lib/eye/io/unix_socket.rb +0 -39
  28. data/spec/checker/cpu_spec.rb +0 -58
  29. data/spec/checker/file_ctime_spec.rb +0 -34
  30. data/spec/checker/file_size_spec.rb +0 -107
  31. data/spec/checker/http_spec.rb +0 -114
  32. data/spec/checker/memory_spec.rb +0 -64
  33. data/spec/checker/socket_spec.rb +0 -116
  34. data/spec/checker_spec.rb +0 -187
  35. data/spec/child_process/child_process_spec.rb +0 -46
  36. data/spec/client_server_spec.rb +0 -33
  37. data/spec/controller/commands_spec.rb +0 -92
  38. data/spec/controller/controller_spec.rb +0 -157
  39. data/spec/controller/find_objects_spec.rb +0 -176
  40. data/spec/controller/group_spec.rb +0 -110
  41. data/spec/controller/intergration_spec.rb +0 -366
  42. data/spec/controller/load_spec.rb +0 -371
  43. data/spec/controller/races_spec.rb +0 -70
  44. data/spec/controller/stop_on_delete_spec.rb +0 -157
  45. data/spec/dsl/chain_spec.rb +0 -146
  46. data/spec/dsl/checks_spec.rb +0 -219
  47. data/spec/dsl/config_spec.rb +0 -44
  48. data/spec/dsl/dsl_spec.rb +0 -73
  49. data/spec/dsl/getter_spec.rb +0 -223
  50. data/spec/dsl/integration_spec.rb +0 -376
  51. data/spec/dsl/load_spec.rb +0 -52
  52. data/spec/dsl/notify_spec.rb +0 -114
  53. data/spec/dsl/process_spec.rb +0 -380
  54. data/spec/dsl/sub_procs_spec.rb +0 -93
  55. data/spec/dsl/with_server_spec.rb +0 -128
  56. data/spec/example/em.rb +0 -57
  57. data/spec/example/forking.rb +0 -20
  58. data/spec/example/sample.rb +0 -154
  59. data/spec/fixtures/dsl/0.rb +0 -8
  60. data/spec/fixtures/dsl/0a.rb +0 -8
  61. data/spec/fixtures/dsl/0c.rb +0 -8
  62. data/spec/fixtures/dsl/1.rb +0 -5
  63. data/spec/fixtures/dsl/bad.eye +0 -6
  64. data/spec/fixtures/dsl/configs/1.eye +0 -3
  65. data/spec/fixtures/dsl/configs/2.eye +0 -1
  66. data/spec/fixtures/dsl/configs/3.eye +0 -1
  67. data/spec/fixtures/dsl/configs/4.eye +0 -3
  68. data/spec/fixtures/dsl/empty.eye +0 -20
  69. data/spec/fixtures/dsl/include_test.eye +0 -5
  70. data/spec/fixtures/dsl/include_test/1.rb +0 -6
  71. data/spec/fixtures/dsl/include_test/ha.rb +0 -4
  72. data/spec/fixtures/dsl/include_test2.eye +0 -5
  73. data/spec/fixtures/dsl/integration.eye +0 -30
  74. data/spec/fixtures/dsl/integration2.eye +0 -32
  75. data/spec/fixtures/dsl/integration_locks.eye +0 -30
  76. data/spec/fixtures/dsl/integration_sor.eye +0 -32
  77. data/spec/fixtures/dsl/integration_sor2.eye +0 -27
  78. data/spec/fixtures/dsl/integration_sor3.eye +0 -32
  79. data/spec/fixtures/dsl/load.eye +0 -25
  80. data/spec/fixtures/dsl/load2.eye +0 -7
  81. data/spec/fixtures/dsl/load2_dup2.eye +0 -13
  82. data/spec/fixtures/dsl/load2_dup_pid.eye +0 -7
  83. data/spec/fixtures/dsl/load3.eye +0 -10
  84. data/spec/fixtures/dsl/load4.eye +0 -7
  85. data/spec/fixtures/dsl/load5.eye +0 -8
  86. data/spec/fixtures/dsl/load6.eye +0 -17
  87. data/spec/fixtures/dsl/load_dubls.eye +0 -36
  88. data/spec/fixtures/dsl/load_dup_ex_names.eye +0 -15
  89. data/spec/fixtures/dsl/load_error.eye +0 -5
  90. data/spec/fixtures/dsl/load_error_folder/load3.eye +0 -10
  91. data/spec/fixtures/dsl/load_error_folder/load4.eye +0 -7
  92. data/spec/fixtures/dsl/load_folder/load3.eye +0 -10
  93. data/spec/fixtures/dsl/load_folder/load4.eye +0 -7
  94. data/spec/fixtures/dsl/load_int.eye +0 -8
  95. data/spec/fixtures/dsl/load_int2.eye +0 -13
  96. data/spec/fixtures/dsl/load_logger.eye +0 -26
  97. data/spec/fixtures/dsl/load_logger2.eye +0 -3
  98. data/spec/fixtures/dsl/long_load.eye +0 -5
  99. data/spec/fixtures/dsl/subfolder1/proc1.rb +0 -3
  100. data/spec/fixtures/dsl/subfolder2.eye +0 -9
  101. data/spec/fixtures/dsl/subfolder2/common.rb +0 -1
  102. data/spec/fixtures/dsl/subfolder2/proc2.rb +0 -3
  103. data/spec/fixtures/dsl/subfolder2/sub/proc3.rb +0 -6
  104. data/spec/fixtures/dsl/subfolder3.eye +0 -8
  105. data/spec/fixtures/dsl/subfolder3/common.rb +0 -1
  106. data/spec/fixtures/dsl/subfolder3/proc4.rb +0 -3
  107. data/spec/fixtures/dsl/subfolder3/sub/proc5.rb +0 -6
  108. data/spec/fixtures/dsl/subfolder4.eye +0 -6
  109. data/spec/fixtures/dsl/subfolder4/a.rb +0 -2
  110. data/spec/fixtures/dsl/subfolder4/b.rb +0 -1
  111. data/spec/fixtures/dsl/subfolder4/c.rb +0 -1
  112. data/spec/mock_spec.rb +0 -31
  113. data/spec/notify/jabber_spec.rb +0 -25
  114. data/spec/notify/mail_spec.rb +0 -26
  115. data/spec/notify_spec.rb +0 -90
  116. data/spec/process/checks/child_checks_spec.rb +0 -79
  117. data/spec/process/checks/cpu_spec.rb +0 -114
  118. data/spec/process/checks/ctime_spec.rb +0 -43
  119. data/spec/process/checks/fsize_spec.rb +0 -22
  120. data/spec/process/checks/http_spec.rb +0 -52
  121. data/spec/process/checks/intergration_spec.rb +0 -32
  122. data/spec/process/checks/memory_spec.rb +0 -127
  123. data/spec/process/child_process_spec.rb +0 -125
  124. data/spec/process/config_spec.rb +0 -74
  125. data/spec/process/controller_spec.rb +0 -173
  126. data/spec/process/monitoring_spec.rb +0 -180
  127. data/spec/process/notify_spec.rb +0 -27
  128. data/spec/process/restart_spec.rb +0 -186
  129. data/spec/process/scheduler_spec.rb +0 -178
  130. data/spec/process/start_spec.rb +0 -261
  131. data/spec/process/states_history_spec.rb +0 -123
  132. data/spec/process/stop_spec.rb +0 -156
  133. data/spec/process/system_spec.rb +0 -136
  134. data/spec/process/triggers/flapping_spec.rb +0 -242
  135. data/spec/process/update_config_spec.rb +0 -62
  136. data/spec/spec_helper.rb +0 -128
  137. data/spec/support/rr_celluloid.rb +0 -15
  138. data/spec/support/spec_support.rb +0 -163
  139. data/spec/system_resources_spec.rb +0 -56
  140. data/spec/system_spec.rb +0 -174
  141. data/spec/utils/alive_array_spec.rb +0 -49
  142. data/spec/utils/celluloid_chain_spec.rb +0 -89
  143. data/spec/utils/tail_spec.rb +0 -20
@@ -1,74 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe "Eye::Process::Config" do
4
-
5
- it "should use throught [], c" do
6
- @p = Eye::Process.new({:pid_file => '1.pid', :start_command => "a", :working_dir => "/tmp"})
7
- @p[:pid_file].should == "1.pid"
8
- @p[:pid_file_ex].should == "/tmp/1.pid"
9
- @p[:checks].should == {}
10
- end
11
-
12
- it "c interface" do
13
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid', :start_command => "a"})
14
- @p.c(:pid_file_ex).should == "/tmp/1.pid"
15
- end
16
-
17
- it "should expand stdout" do
18
- @p = Eye::Process.new({:working_dir => "/tmp", :stdout => '1.log', :start_command => "a", :pid_file => '/tmp/1.pid'})
19
- @p[:stdout].should == "/tmp/1.log"
20
- end
21
-
22
- it "check and triggers should {} if empty" do
23
- @p = Eye::Process.new({:working_dir => "/tmp", :stdout => '1.log', :start_command => "a", :pid_file => '/tmp/1.pid', :triggers => {}})
24
- @p[:checks].should == {}
25
- @p[:triggers].should == {:flapping => {:type=>:flapping, :times=>10, :within=>10}}
26
- end
27
-
28
- it "if trigger setted, no rewrite" do
29
- @p = Eye::Process.new({:working_dir => "/tmp", :stdout => '1.log', :start_command => "a", :pid_file => '/tmp/1.pid', :triggers => {:flapping => {:type=>:flapping, :times=>100, :within=>100}}})
30
- @p[:triggers].should == {:flapping => {:type=>:flapping, :times=>100, :within=>100}}
31
- end
32
-
33
- describe "control_pid?" do
34
- it "if daemonize than true" do
35
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid', :daemonize => true})
36
- @p.control_pid?.should == true
37
- end
38
-
39
- it "if not daemonize than false" do
40
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid'})
41
- @p.control_pid?.should == false
42
- end
43
-
44
- it "true if not daemonize, but manual" do
45
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid', :daemonize => false, :control_pid => true})
46
- @p.control_pid?.should == true
47
- end
48
-
49
- end
50
-
51
- describe ":childs_update_period" do
52
- it "should set default" do
53
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid'})
54
- @p[:childs_update_period].should == 30.seconds
55
- end
56
-
57
- it "should set from global options" do
58
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid', :childs_update_period => 11.seconds})
59
- @p[:childs_update_period].should == 11.seconds
60
- end
61
-
62
- it "should set from monitor_children sub options" do
63
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid', :monitor_children => {:childs_update_period => 12.seconds}})
64
- @p[:childs_update_period].should == 12.seconds
65
- end
66
-
67
- it "should set from monitor_children sub options" do
68
- @p = Eye::Process.new({:pid_file => '/tmp/1.pid', :childs_update_period => 11.seconds, :monitor_children => {:childs_update_period => 12.seconds}})
69
- @p[:childs_update_period].should == 12.seconds
70
- end
71
-
72
- end
73
-
74
- end
@@ -1,173 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe "Process Controller" do
4
-
5
- describe "monitor" do
6
- it "monitor should call start, as the auto_start is default" do
7
- @process = process C.p1
8
-
9
- proxy(@process).start
10
- @process.monitor
11
- sleep 1
12
-
13
- @process.state_name.should == :up
14
- end
15
-
16
- it "without auto_start and process not running" do
17
- @process = process C.p1.merge(:auto_start => false)
18
- @process.monitor
19
- sleep 1
20
-
21
- @process.state_name.should == :unmonitored
22
- end
23
-
24
- it "without auto_start and process already running" do
25
- @pid = Eye::System.daemonize(C.p1[:start_command], C.p1)[:pid]
26
- Eye::System.pid_alive?(@pid).should == true
27
- File.open(C.p1[:pid_file], 'w'){|f| f.write(@pid) }
28
- sleep 2
29
-
30
- @process = process C.p1.merge(:auto_start => false)
31
- @process.monitor
32
- sleep 1
33
-
34
- @process.state_name.should == :up
35
- @process.pid.should == @pid
36
- end
37
-
38
- end
39
-
40
- describe "unmonitor" do
41
- [C.p1, C.p2].each do |cfg|
42
- it "should just forget about any process #{cfg[:name]}" do
43
- start_ok_process
44
- old_pid = @process.pid
45
-
46
- @process.unmonitor
47
-
48
- Eye::System.pid_alive?(old_pid).should == true
49
-
50
- @process.pid.should == nil
51
- @process.state_name.should == :unmonitored
52
-
53
- @process.watchers.keys.should == []
54
- @process.load_pid_from_file.should == old_pid
55
-
56
- sleep 1
57
-
58
- # event if something now kill the process
59
- die_process!(old_pid)
60
-
61
- # nothing try to up it
62
- sleep 5
63
-
64
- @process.state_name.should == :unmonitored
65
- @process.load_pid_from_file.should == old_pid
66
- end
67
- end
68
- end
69
-
70
- describe "delete" do
71
- it "delete monitoring, not kill process" do
72
- start_ok_process
73
- old_pid = @process.pid
74
-
75
- @process.delete
76
- Eye::System.pid_alive?(old_pid).should == true
77
- sleep 0.3
78
- @process.alive?.should == false
79
-
80
- @process = nil
81
- end
82
-
83
- it "if stop_on_delete process die" do
84
- start_ok_process(C.p1.merge(:stop_on_delete => true))
85
- old_pid = @process.pid
86
-
87
- @process.delete
88
- Eye::System.pid_alive?(old_pid).should == false
89
- sleep 0.3
90
- @process.alive?.should == false
91
-
92
- @process = nil
93
- end
94
- end
95
-
96
- describe "stop" do
97
- it "stop kill process, and moving to unmonitored" do
98
- start_ok_process
99
-
100
- @process.stop
101
-
102
- Eye::System.pid_alive?(@pid).should == false
103
- @process.state_name.should == :unmonitored
104
- @process.states_history.end?(:down, :unmonitored).should == true
105
-
106
- # should clear pid
107
- @process.pid.should == nil
108
- end
109
-
110
- it "if cant kill process, moving to unmonitored too" do
111
- start_ok_process(C.p1.merge(:stop_command => "which ruby"))
112
-
113
- @process.watchers.keys.should == [:check_alive]
114
-
115
- @process.stop
116
-
117
- Eye::System.pid_alive?(@pid).should == true
118
- @process.state_name.should == :unmonitored
119
- @process.states_history.end?(:stopping, :unmonitored, :unmonitored).should == true
120
-
121
- # should clear pid
122
- @process.pid.should == nil
123
- @process.watchers.keys.should == []
124
- end
125
- end
126
-
127
- describe "process cant start, crash each time" do
128
- before :each do
129
- @process = process(C.p2.merge(:start_command => C.p2[:start_command] + " -r" ))
130
- @process.send_command :start
131
- end
132
-
133
- it "we send command to stop it" do
134
- # process flapping here some times
135
- sleep 10
136
-
137
- # now send stop command
138
- @process.send_command :stop
139
- sleep 7
140
-
141
- # process should be stopped here
142
- @process.state_name.should == :unmonitored
143
- end
144
-
145
- it "we send command to unmonitor it" do
146
- # process flapping here some times
147
- sleep 10
148
-
149
- # now send stop command
150
- @process.send_command :unmonitor
151
- sleep 7
152
-
153
- # process should be stopped here
154
- @process.state_name.should == :unmonitored
155
- end
156
- end
157
-
158
- describe "signal" do
159
- before :each do
160
- @process = process(C.p1)
161
- @process.pid = 122345
162
- end
163
-
164
- it "mock send_signal" do
165
- mock(@process).send_signal(9)
166
- @process.signal(9)
167
-
168
- mock(@process).send_signal('9')
169
- @process.signal('9')
170
- end
171
- end
172
-
173
- end
@@ -1,180 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe "Process Monitoring" do
4
-
5
- [C.p1, C.p2].each do |cfg|
6
- it "process crashed, should restart #{cfg[:name]}" do
7
- start_ok_process(cfg)
8
- old_pid = @pid
9
-
10
- die_process!(@pid)
11
- mock(@process).notify(:warn, anything)
12
-
13
- sleep 10 # wait until monitor upping process
14
-
15
- @pid = @process.pid
16
- @pid.should_not == old_pid
17
-
18
- Eye::System.pid_alive?(old_pid).should == false
19
- Eye::System.pid_alive?(@pid).should == true
20
-
21
- @process.state_name.should == :up
22
- @process.states_history.seq?(:down, :starting, :up).should == true
23
- @process.watchers.keys.should == [:check_alive]
24
- @process.load_pid_from_file.should == @process.pid
25
- end
26
-
27
- it "someone remove pid_file. should rewrite" do
28
- start_ok_process(cfg)
29
- old_pid = @pid
30
- File.exists?(cfg[:pid_file]).should == true
31
-
32
- FileUtils.rm(cfg[:pid_file]) # someone removes it (bad man)
33
- File.exists?(cfg[:pid_file]).should == false
34
-
35
- sleep 10 # wait until monitor understand it
36
-
37
- File.exists?(cfg[:pid_file]).should == true
38
- @process.pid.should == old_pid
39
- @process.load_pid_from_file.should == @process.pid
40
- @process.state_name.should == :up
41
- end
42
-
43
- it "someone rewrite pid_file. should rewrite for daemonize only" do
44
- start_ok_process(cfg)
45
- old_pid = @pid
46
- @process.load_pid_from_file.should == @pid
47
-
48
- File.open(cfg[:pid_file], 'w'){|f| f.write(99999) }
49
- @process.load_pid_from_file.should == 99999
50
-
51
- sleep 10 # wait until monitor understand it
52
-
53
- if cfg[:daemonize]
54
- @process.load_pid_from_file.should == @pid
55
- else
56
- @process.load_pid_from_file.should == 99999
57
- end
58
-
59
- @process.pid.should == old_pid
60
- @process.state_name.should == :up
61
- end
62
-
63
- it "someone rewrite pid_file. and ctime > limit, should rewrite for both" do
64
- start_ok_process(cfg)
65
- old_pid = @pid
66
- @process.load_pid_from_file.should == @pid
67
-
68
- silence_warnings{ Eye::Process::Monitor::REWRITE_FACKUP_PIDFILE_PERIOD = 4.seconds }
69
-
70
- File.open(cfg[:pid_file], 'w'){|f| f.write(99999) }
71
- @process.load_pid_from_file.should == 99999
72
-
73
- sleep 15 # wait until monitor understand it
74
-
75
- @process.load_pid_from_file.should == @pid
76
-
77
- @process.pid.should == old_pid
78
- @process.state_name.should == :up
79
-
80
- silence_warnings{ Eye::Process::Monitor::REWRITE_FACKUP_PIDFILE_PERIOD = 2.minutes }
81
- end
82
-
83
- it "EMULATE UNICORN someone rewrite pid_file and process die (should read actual pid from file)" do
84
- start_ok_process(cfg)
85
- old_pid = @pid
86
-
87
- # rewrite by another :)
88
- @pid = Eye::System.daemonize("ruby sample.rb", {:environment => {"ENV1" => "SECRET1"},
89
- :working_dir => cfg[:working_dir], :stdout => @log})[:pid]
90
-
91
- File.open(cfg[:pid_file], 'w'){|f| f.write(@pid) }
92
-
93
- die_process!(old_pid)
94
-
95
- sleep 10 # wait until monitor upping process
96
-
97
- @process.pid.should == @pid
98
- old_pid.should_not == @pid
99
-
100
- Eye::System.pid_alive?(old_pid).should == false
101
- Eye::System.pid_alive?(@pid).should == true
102
-
103
- @process.state_name.should == :up
104
- @process.watchers.keys.should == [:check_alive]
105
- @process.load_pid_from_file.should == @process.pid
106
- end
107
-
108
- end
109
-
110
- it "EMULATE UNICORN2 hard understanding restart case" do
111
- start_ok_process(C.p2)
112
- old_pid = @pid
113
-
114
- # rewrite by another :)
115
- @pid = Eye::System.daemonize("ruby sample.rb", {:environment => {"ENV1" => "SECRET1"},
116
- :working_dir => C.p2[:working_dir], :stdout => @log})[:pid]
117
-
118
- File.open(C.p2[:pid_file], 'w'){|f| f.write(@pid) }
119
-
120
- sleep 5
121
-
122
- # both processes exists now
123
- # and in pid_file writed second pid
124
- @process.load_pid_from_file.should == @pid
125
- @process.pid.should == old_pid
126
-
127
- die_process!(old_pid)
128
-
129
- sleep 5 # wait until monitor upping process
130
-
131
- @process.pid.should == @pid
132
- old_pid.should_not == @pid
133
- @process.load_pid_from_file.should == @pid
134
-
135
- Eye::System.pid_alive?(old_pid).should == false
136
- Eye::System.pid_alive?(@pid).should == true
137
-
138
- @process.state_name.should == :up
139
- @process.watchers.keys.should == [:check_alive]
140
- @process.load_pid_from_file.should == @process.pid
141
- end
142
-
143
- it "if keep_alive disabled, process should not up" do
144
- start_ok_process(C.p1.merge(:keep_alive => false))
145
- old_pid = @process.pid
146
-
147
- die_process!(@pid)
148
-
149
- sleep 10 # wait until monitor upping process
150
-
151
- @process.pid.should == nil
152
- Eye::System.pid_alive?(@pid).should == false
153
-
154
- @process.state_name.should == :unmonitored
155
- @process.watchers.keys.should == []
156
- @process.states_history.end?(:up, :down, :unmonitored).should == true
157
- @process.load_pid_from_file.should == old_pid # i think this ok
158
- end
159
-
160
- it "process in status unmonitored should not up automatically" do
161
- start_ok_process(C.p1)
162
- old_pid = @pid
163
-
164
- @process.unmonitor
165
- @process.state_name.should == :unmonitored
166
-
167
- die_process!(@pid)
168
-
169
- sleep 10 # wait until monitor upping process
170
-
171
- @process.pid.should == nil
172
-
173
- Eye::System.pid_alive?(old_pid).should == false
174
-
175
- @process.state_name.should == :unmonitored
176
- @process.watchers.keys.should == []
177
- @process.load_pid_from_file.should == old_pid
178
- end
179
-
180
- end
@@ -1,27 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe "Eye::Process::Notify" do
4
- before :each do
5
- stub(Eye::System).host{ 'host1' }
6
- @process = process(C.p1.merge(:notify => {'vasya' => :warn,
7
- 'petya' => :crit, 'somebody' => :crit}))
8
- end
9
-
10
- it "should send to notifies warn message" do
11
- m = {:message=>"something", :name=>"blocking process", :full_name=>"main:default:blocking process", :pid=>nil, :host=>"host1", :level=>:warn}
12
- mock(Eye::Notify).notify('vasya', hash_including(m))
13
- @process.notify(:warn, 'something')
14
- end
15
-
16
- it "should send to notifies crit message" do
17
- m = {:message=>"something", :name=>"blocking process",
18
- :full_name=>"main:default:blocking process", :pid=>nil,
19
- :host=>'host1', :level=>:crit}
20
-
21
- mock(Eye::Notify).notify('vasya', hash_including(m))
22
- mock(Eye::Notify).notify('petya', hash_including(m))
23
- mock(Eye::Notify).notify('somebody', hash_including(m))
24
- @process.notify(:crit, 'something')
25
- end
26
-
27
- end