sys-proctree 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
data/lib/sys/proctree.rb
CHANGED
data/lib/sys/proctree/version.rb
CHANGED
@@ -10,9 +10,9 @@ describe ::Sys::ProcTree::Process do
|
|
10
10
|
let(:tree_pids) { [2, 6, 8] }
|
11
11
|
|
12
12
|
before(:each) do
|
13
|
-
::Sys::ProcTree::Tree.stub
|
14
|
-
::Process.stub
|
15
|
-
::Process.stub
|
13
|
+
::Sys::ProcTree::Tree.stub(:find).and_return([2, 6, 8])
|
14
|
+
::Process.stub(:kill)
|
15
|
+
::Process.stub(:wait)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should discover the pids of the process tree" do
|
@@ -36,7 +36,7 @@ describe ::Sys::ProcTree::Process do
|
|
36
36
|
|
37
37
|
it "should return the exit status of all killed processes" do
|
38
38
|
wait_results = tree_pids.map do |pid|
|
39
|
-
[pid, double(Process::Status)].tap { |result| ::Process.stub
|
39
|
+
[pid, double(Process::Status)].tap { |result| ::Process.stub(:wait).with(pid).and_return(result) }
|
40
40
|
end
|
41
41
|
|
42
42
|
TestableProcess.kill_tree(kill_signal, 8).should eql(wait_results)
|
@@ -46,7 +46,7 @@ describe ::Sys::ProcTree::Process do
|
|
46
46
|
|
47
47
|
let(:kill_signal) { 9 }
|
48
48
|
|
49
|
-
before(:each) { ::Process.stub
|
49
|
+
before(:each) { ::Process.stub(:kill).with(kill_signal, 6).and_raise("No such process") }
|
50
50
|
|
51
51
|
it "should continue to kill subsequent processes" do
|
52
52
|
[2, 8].each { |pid| ::Process.should_receive(:kill).with(kill_signal, pid) }
|
@@ -56,8 +56,8 @@ describe ::Sys::ProcTree::Process do
|
|
56
56
|
|
57
57
|
it "should return an exit status of nil" do
|
58
58
|
wait_results = [[2, double(Process::Status)], [6, nil], [8, double(Process::Status)]]
|
59
|
-
::Process.stub
|
60
|
-
::Process.stub
|
59
|
+
::Process.stub(:wait).with(2).and_return(wait_results[0])
|
60
|
+
::Process.stub(:wait).with(8).and_return(wait_results[2])
|
61
61
|
|
62
62
|
TestableProcess.kill_tree(kill_signal, 8).should eql(wait_results)
|
63
63
|
end
|
@@ -21,7 +21,7 @@ describe ::Sys::ProcTree::Tree do
|
|
21
21
|
|
22
22
|
describe "when the provided process exists" do
|
23
23
|
|
24
|
-
before(:each) { process_status_list.stub
|
24
|
+
before(:each) { process_status_list.stub(:exists?).with(pid).and_return(true) }
|
25
25
|
|
26
26
|
describe "when the tree is more than one level deep" do
|
27
27
|
|
@@ -51,7 +51,7 @@ describe ::Sys::ProcTree::Tree do
|
|
51
51
|
|
52
52
|
describe "when the provided process does not exist" do
|
53
53
|
|
54
|
-
before(:each) { process_status_list.stub
|
54
|
+
before(:each) { process_status_list.stub(:exists?).and_return(false) }
|
55
55
|
|
56
56
|
it "should return an empty array" do
|
57
57
|
tree.find(0).should be_empty
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'bundler'
|
2
|
+
Bundler.require(:default, :development)
|
3
|
+
|
4
|
+
SimpleCov.start do
|
5
|
+
add_filter "/spec/"
|
6
|
+
add_filter "/vendor/"
|
7
|
+
minimum_coverage 100
|
8
|
+
refuse_coverage_drop
|
9
|
+
end if ENV["coverage"]
|
2
10
|
|
3
11
|
require_relative "../lib/sys/proctree"
|
4
|
-
Bundler.require(:test)
|
5
12
|
|
6
13
|
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |file| require file }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-proctree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sys-proctable
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.9
|
21
|
+
version: '0.9'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,39 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.9
|
29
|
+
version: '0.9'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: travis-lint
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.7'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.7'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: metric_fu
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '4.5'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.5'
|
30
62
|
- !ruby/object:Gem::Dependency
|
31
63
|
name: rspec
|
32
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +66,7 @@ dependencies:
|
|
34
66
|
requirements:
|
35
67
|
- - ~>
|
36
68
|
- !ruby/object:Gem::Version
|
37
|
-
version: '2.
|
69
|
+
version: '2.14'
|
38
70
|
type: :development
|
39
71
|
prerelease: false
|
40
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,15 +74,15 @@ dependencies:
|
|
42
74
|
requirements:
|
43
75
|
- - ~>
|
44
76
|
- !ruby/object:Gem::Version
|
45
|
-
version: '2.
|
77
|
+
version: '2.14'
|
46
78
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
79
|
+
name: os
|
48
80
|
requirement: !ruby/object:Gem::Requirement
|
49
81
|
none: false
|
50
82
|
requirements:
|
51
83
|
- - ~>
|
52
84
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
85
|
+
version: '0.9'
|
54
86
|
type: :development
|
55
87
|
prerelease: false
|
56
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,15 +90,15 @@ dependencies:
|
|
58
90
|
requirements:
|
59
91
|
- - ~>
|
60
92
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
93
|
+
version: '0.9'
|
62
94
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
95
|
+
name: rake
|
64
96
|
requirement: !ruby/object:Gem::Requirement
|
65
97
|
none: false
|
66
98
|
requirements:
|
67
99
|
- - ~>
|
68
100
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
101
|
+
version: '10.1'
|
70
102
|
type: :development
|
71
103
|
prerelease: false
|
72
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,15 +106,15 @@ dependencies:
|
|
74
106
|
requirements:
|
75
107
|
- - ~>
|
76
108
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
109
|
+
version: '10.1'
|
78
110
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
111
|
+
name: simplecov
|
80
112
|
requirement: !ruby/object:Gem::Requirement
|
81
113
|
none: false
|
82
114
|
requirements:
|
83
115
|
- - ~>
|
84
116
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
117
|
+
version: '0.8'
|
86
118
|
type: :development
|
87
119
|
prerelease: false
|
88
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +122,7 @@ dependencies:
|
|
90
122
|
requirements:
|
91
123
|
- - ~>
|
92
124
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
125
|
+
version: '0.8'
|
94
126
|
description: Discovers and kills process trees via process lists provided by the sys-proctable
|
95
127
|
gem
|
96
128
|
email: matthew.ueckerman@myob.com
|
@@ -133,6 +165,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
165
|
- - ! '>='
|
134
166
|
- !ruby/object:Gem::Version
|
135
167
|
version: '0'
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
hash: -3722882883959153193
|
136
171
|
requirements: []
|
137
172
|
rubyforge_project: sys-proctree
|
138
173
|
rubygems_version: 1.8.25
|