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,116 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- def chsock(cfg = {})
4
- Eye::Checker.create(nil, {:type => :socket, :every => 5.seconds,
5
- :times => 1, :addr => 'tcp://127.0.0.1:33231', :send_data => "ping",
6
- :expect_data => /pong/, :timeout => 2}.merge(cfg))
7
- end
8
-
9
- def chsockb(cfg = {})
10
- Eye::Checker.create(nil, {:type => :socket, :every => 5.seconds,
11
- :times => 1, :addr => 'tcp://127.0.0.1:33232', :protocol => :em_object, :send_data => {},
12
- :expect_data => /pong/, :timeout => 2}.merge(cfg))
13
- end
14
-
15
- describe "Socket Checker" do
16
- %w[ tcp://127.0.0.1:33231 unix:/tmp/em_test_sock_spec].each do |addr|
17
- describe "socket: '#{addr}'" do
18
- before :each do
19
- start_ok_process(C.p4)
20
- end
21
-
22
- it "good answer" do
23
- c = chsock(:addr => addr)
24
- c.get_value.should == {:result => 'pong'}
25
- c.check.should == true
26
-
27
- c = chsock(:addr => addr, :expect_data => "pong") # string result ok too
28
- c.check.should == true
29
- end
30
-
31
- it "timeouted" do
32
- c = chsock(:addr => addr, :send_data => "timeout")
33
- c.get_value.should == {:exception => "ReadTimeout<2.0>"}
34
- c.check.should == false
35
- end
36
-
37
- it "bad answer" do
38
- c = chsock(:addr => addr, :send_data => "bad")
39
- c.get_value.should == {:result => 'what'}
40
- c.check.should == false
41
-
42
- c = chsock(:addr => addr, :send_data => "bad", :expect_data => "pong") # string result bad too
43
- c.check.should == false
44
- end
45
-
46
- it "socket not found" do
47
- @process.stop
48
- c = chsock(:addr => addr.chop)
49
- if addr =~ /tcp/
50
- c.get_value.should == {:exception => "Error<Connection refused - connect(2)>"}
51
- else
52
- c.get_value[:exception].should include("No such file or directory")
53
- end
54
- c.check.should == false
55
- end
56
-
57
- it "check responding without send_data" do
58
- c = chsock(:addr => addr, :send_data => nil, :expect_data => nil)
59
- c.get_value.should == {:result => :listen}
60
- c.check.should == true
61
- end
62
-
63
- it "check responding without send_data" do
64
- c = chsock(:addr => addr.chop, :send_data => nil, :expect_data => nil)
65
- if addr =~ /tcp/
66
- c.get_value.should == {:exception => "Error<Connection refused - connect(2)>"}
67
- else
68
- c.get_value[:exception].should include("No such file or directory")
69
- end
70
- c.check.should == false
71
- end
72
- end
73
-
74
- end
75
-
76
- describe "em object protocol" do
77
- before :each do
78
- start_ok_process(C.p4)
79
- end
80
-
81
- it "good answer" do
82
- c = chsockb(:send_data => {:command => 'ping'}, :expect_data => 'pong')
83
- c.get_value.should == {:result => 'pong'}
84
- c.check.should == true
85
-
86
- c = chsockb(:send_data => {:command => 'ping'}, :expect_data => /pong/)
87
- c.check.should == true
88
-
89
- c = chsockb(:send_data => {:command => 'ping'}, :expect_data => lambda{|r| r == 'pong'})
90
- c.check.should == true
91
- end
92
-
93
- it "should correctly get big message" do
94
- c = chsockb(:send_data => {:command => 'big'})
95
- res = c.get_value[:result]
96
- res.size.should == 9_999_999
97
- end
98
-
99
- it "when raised in proc, good? == false" do
100
- c = chsockb(:send_data => {:command => 'ping'}, :expect_data => lambda{|r| raise 'haha'})
101
- c.check.should == false
102
- end
103
-
104
- it "bad answer" do
105
- c = chsockb(:send_data => {:command => 'bad'}, :expect_data => 'pong')
106
- c.get_value.should == {:result => 'what'}
107
- c.check.should == false
108
-
109
- c = chsockb(:send_data => {:command => 'bad'}, :expect_data => /pong/)
110
- c.check.should == false
111
-
112
- c = chsockb(:send_data => {:command => 'bad'}, :expect_data => lambda{|r| r == 'pong'})
113
- c.check.should == false
114
- end
115
- end
116
- end
@@ -1,187 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- class Checker1 < Eye::Checker
4
-
5
- def get_value
6
- true
7
- end
8
-
9
- def good?(value)
10
- value
11
- end
12
- end
13
-
14
- class Checker2 < Eye::Checker
15
- param :bla, [String, Symbol]
16
- param :bla2, [String, Symbol], true
17
- param :bla3, [String, Symbol], true, "hi"
18
- param :bla4, [String, Symbol], false, "hi2"
19
- param :bla5, [Fixnum, Float]
20
- end
21
-
22
- describe "Eye::Checker" do
23
-
24
- it "defaults" do
25
- @c = Checker1.new(1, {:times => 3})
26
- @c.max_tries.should == 3
27
- @c.min_tries.should == 3
28
- end
29
-
30
- it "defaults" do
31
- @c = Checker1.new(1, {:times => [3, 5]})
32
- @c.max_tries.should == 5
33
- @c.min_tries.should == 3
34
- end
35
-
36
- it "defaults" do
37
- @c = Checker1.new(1, {})
38
- @c.max_tries.should == 1
39
- @c.min_tries.should == 1
40
- end
41
-
42
- describe "one digit" do
43
- before :each do
44
- @c = Checker1.new(1, {:times => 3, :bla => 1})
45
- end
46
-
47
- it "times 3 from 3" do
48
- @c.check.should == true
49
- @c.check.should == true
50
- @c.check.should == true
51
- @c.check.should == true
52
- end
53
-
54
- it "times 3 from 3" do
55
- stub(@c).get_value{true}
56
- @c.check.should == true
57
- stub(@c).get_value{false}
58
- @c.check.should == true
59
- stub(@c).get_value{false}
60
- @c.check.should == true
61
-
62
- stub(@c).get_value{true}
63
- @c.check.should == true
64
- end
65
-
66
- it "times 3 from 3" do
67
- stub(@c).get_value{true}
68
- @c.check.should == true
69
- stub(@c).get_value{false}
70
- @c.check.should == true
71
- stub(@c).get_value{false}
72
- @c.check.should == true
73
-
74
- stub(@c).get_value{false}
75
- @c.check.should == false
76
- end
77
-
78
- end
79
-
80
- describe "two digits" do
81
- before :each do
82
- @c = Checker1.new(1, {:times => [2,5], :bla => 1})
83
- end
84
-
85
- it "2 from 5" do
86
- @c.check.should == true
87
- @c.check.should == true
88
- @c.check.should == true
89
- @c.check.should == true
90
- @c.check.should == true
91
- @c.check.should == true
92
- end
93
-
94
- it "times 2 from 5" do
95
- stub(@c).get_value{true}
96
- @c.check.should == true
97
- stub(@c).get_value{false}
98
- @c.check.should == true
99
- stub(@c).get_value{true}
100
- @c.check.should == true
101
-
102
- stub(@c).get_value{true}
103
- @c.check.should == true
104
-
105
- stub(@c).get_value{true}
106
- @c.check.should == true
107
-
108
- stub(@c).get_value{true}
109
- @c.check.should == true
110
- end
111
-
112
-
113
- it "times 2 from 5" do
114
- stub(@c).get_value{true}
115
- @c.check.should == true
116
- stub(@c).get_value{false}
117
- @c.check.should == true
118
- stub(@c).get_value{false}
119
- @c.check.should == true
120
-
121
- stub(@c).get_value{true}
122
- @c.check.should == true
123
-
124
- stub(@c).get_value{true}
125
- @c.check.should == false
126
-
127
- stub(@c).get_value{true}
128
- @c.check.should == false
129
-
130
- stub(@c).get_value{true}
131
- @c.check.should == true
132
- end
133
- end
134
-
135
- describe "default validates" do
136
- it "validate by default" do
137
- Checker1.validate({:times => 3})
138
- end
139
-
140
- it "validate by default" do
141
- expect{ Checker1.validate({:times => "jopa"}) }.to raise_error(Eye::Dsl::Validation::Error)
142
- end
143
- end
144
-
145
- it "defaults every" do
146
- @c = Checker1.new(nil, {:times => 3})
147
- @c.every.should == 5
148
- end
149
-
150
- it "not defaults every" do
151
- @c = Checker1.new(nil, {:times => 3, :every => 10})
152
- @c.every.should == 10
153
- end
154
-
155
- describe "validates" do
156
- it "validate ok" do
157
- Checker2.validate({:bla2 => :a111})
158
- Checker2.validate({:bla2 => "111"})
159
- Checker2.validate({:bla2 => "111", :bla => :bla})
160
- Checker2.validate({:bla2 => "111", :bla5 => 10.minutes})
161
- Checker2.validate({:bla2 => "111", :bla5 => 15.4.seconds})
162
-
163
- c = Checker2.new(nil, :bla2 => :a111)
164
- c.bla.should == nil
165
- c.bla2.should == :a111
166
- c.bla3.should == 'hi'
167
- c.bla4.should == 'hi2'
168
-
169
- c = Checker2.new(nil, :bla2 => :a111, :bla3 => "ho", :bla => 'bla')
170
- c.bla.should == 'bla'
171
- c.bla2.should == :a111
172
- c.bla3.should == 'ho'
173
- c.bla4.should == 'hi2'
174
- end
175
-
176
- it "validate bad" do
177
- expect{ Checker2.validate({}) }.to raise_error
178
- expect{ Checker2.validate({:bla => :bla}) }.to raise_error
179
- expect{ Checker2.validate({:bla2 => 123}) }.to raise_error
180
- expect{ Checker2.validate({:bla2 => :hi, :bla3 => {}}) }.to raise_error
181
- expect{ Checker2.validate({:bla => :bla, :bla3 => 1, :bla4 => 2}) }.to raise_error
182
- expect{ Checker2.validate({:bla2 => :hi, :bla5 => []}) }.to raise_error
183
- end
184
-
185
- end
186
-
187
- end
@@ -1,46 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe "Eye::ChildProcess" do
4
-
5
- before :each do
6
- @pid = Eye::System.daemonize(C.p1[:start_command], C.p1)[:pid]
7
- Eye::System.pid_alive?(@pid).should == true
8
- sleep 0.5
9
- end
10
-
11
- it "some process was declared by my child" do
12
- @process = Eye::ChildProcess.new(@pid, {})
13
- @process.pid.should == @pid
14
-
15
- @process.watchers.keys.should == []
16
- end
17
-
18
- describe "restart" do
19
-
20
- it "kill by default command" do
21
- @process = Eye::ChildProcess.new(@pid, {})
22
- @process.schedule :restart
23
-
24
- sleep 0.5
25
- Eye::System.pid_alive?(@pid).should == false
26
- end
27
-
28
- it "kill by stop command" do
29
- @process = Eye::ChildProcess.new(@pid, {:stop_command => "kill -9 {{PID}}"})
30
- @process.schedule :restart
31
-
32
- sleep 0.5
33
- Eye::System.pid_alive?(@pid).should == false
34
- end
35
-
36
- it "try to snd URS1" do
37
- @process = Eye::ChildProcess.new(@pid, {:stop_command => "kill -USR1 {{PID}}"})
38
- @process.schedule :restart
39
-
40
- sleep 0.5
41
- Eye::System.pid_alive?(@pid).should == true
42
- end
43
- end
44
-
45
- end
46
-
@@ -1,33 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe "Eye::Client, Eye::Server" do
4
-
5
- before :each do
6
- @socket_path = C.socket_path
7
- @client = Eye::Client.new(@socket_path)
8
- @server = Eye::Server.new(@socket_path)
9
- end
10
-
11
- after :each do
12
- @server.terminate
13
- end
14
-
15
- it "client command, should send to controller" do
16
- mock(Eye::Control).command('restart', 'samples'){ :command_sended }
17
- mock(Eye::Control).command('stop'){ :command_sended2 }
18
- @server.run!
19
- sleep 0.1
20
-
21
- @client.command('restart', 'samples').should == :command_sended
22
- @client.command('stop').should == :command_sended2
23
- end
24
-
25
- it "another spec works too" do
26
- mock(Eye::Control).command('stop'){ :command_sended2 }
27
- @server.run!
28
- sleep 0.1
29
-
30
- @client.command('stop').should == :command_sended2
31
- end
32
-
33
- end
@@ -1,92 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe "comamnd spec" do
4
- subject{ c = Eye::Controller.new; c.load(fixture("dsl/load.eye")); c }
5
-
6
- before :each do
7
- @apps = subject.applications
8
-
9
- @app1 = @apps.first
10
- @app2 = @apps.last
11
-
12
- @gr1 = @app1.groups[0]
13
- @gr2 = @app1.groups[1]
14
- @gr3 = @app1.groups[2]
15
- @gr4 = @app2.groups[0]
16
-
17
- @p1 = @gr1.processes[0]
18
- @p2 = @gr1.processes[1]
19
- @p3 = @gr2.processes[0]
20
- @p4 = @gr3.processes[0]
21
- @p5 = @gr3.processes[1]
22
- @p6 = @gr4.processes[0]
23
- end
24
-
25
- describe "remove objects" do
26
- it "remove app" do
27
- subject.remove_object_from_tree(@app2)
28
- subject.applications.size.should == 1
29
- subject.applications.first.should == @app1
30
- end
31
-
32
- it "remove group" do
33
- subject.remove_object_from_tree(@gr1)
34
- @app1.groups.should_not include(@gr1)
35
-
36
- subject.remove_object_from_tree(@gr2)
37
- @app1.groups.should_not include(@gr2)
38
-
39
- subject.remove_object_from_tree(@gr3)
40
- @app1.groups.should_not include(@gr3)
41
-
42
- @app1.groups.should be_empty
43
- end
44
-
45
- it "remove process" do
46
- subject.remove_object_from_tree(@p1)
47
- @gr1.processes.should_not include(@p1)
48
-
49
- subject.remove_object_from_tree(@p2)
50
- @gr1.processes.should_not include(@p2)
51
-
52
- @gr1.processes.should be_empty
53
- end
54
- end
55
-
56
- describe "send_command" do
57
- it "nothing" do
58
- subject.load(fixture("dsl/load.eye")).should include(error: false)
59
- subject.send_command(:start, "2341234").should == []
60
- end
61
-
62
- it "unknown" do
63
- subject.load(fixture("dsl/load.eye")).should include(error: false)
64
- subject.send_command(:st33art, "2341234").should == []
65
- end
66
-
67
- [:start, :stop, :restart, :unmonitor].each do |cmd|
68
- it "should send_command #{cmd}" do
69
- any_instance_of(Eye::Process) do |p|
70
- dont_allow(p).send_command(cmd)
71
- end
72
-
73
- mock(@p1).send_command(cmd)
74
-
75
- subject.send_command cmd, "p1"
76
- end
77
- end
78
-
79
- it "delete obj" do
80
- any_instance_of(Eye::Process) do |p|
81
- dont_allow(p).send_command(:delete)
82
- end
83
-
84
- mock(@p1).send_command(:delete)
85
- subject.send_command :delete, "p1"
86
-
87
- subject.all_processes.should_not include(@p1)
88
- subject.all_processes.should include(@p2)
89
- end
90
- end
91
-
92
- end