sys-proctable 0.9.2-universal-mingw32 → 0.9.3-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +315 -310
- data/README +112 -112
- data/Rakefile +185 -174
- data/lib/windows/sys/proctable.rb +1 -1
- data/sys-proctable.gemspec +1 -1
- data/test/test_sys_proctable_all.rb +84 -84
- metadata +2 -2
@@ -15,7 +15,7 @@ module Sys
|
|
15
15
|
class Error < StandardError; end
|
16
16
|
|
17
17
|
# The version of the sys-proctable library
|
18
|
-
VERSION = '0.9.
|
18
|
+
VERSION = '0.9.3'
|
19
19
|
|
20
20
|
# The comm field corresponds to the 'name' field. The 'cmdline' field
|
21
21
|
# is the CommandLine attribute on Windows XP or later, or the
|
data/sys-proctable.gemspec
CHANGED
@@ -1,84 +1,84 @@
|
|
1
|
-
#######################################################################
|
2
|
-
# test_sys_proctable_all.rb
|
3
|
-
#
|
4
|
-
# Test suite for methods common to all platforms. Generally speaking
|
5
|
-
# you should run this test case using the 'rake test' task.
|
6
|
-
#######################################################################
|
7
|
-
require 'rubygems'
|
8
|
-
gem 'test-unit'
|
9
|
-
|
10
|
-
require 'test/unit'
|
11
|
-
require 'sys/proctable'
|
12
|
-
require 'test/test_sys_top'
|
13
|
-
include Sys
|
14
|
-
|
15
|
-
class TC_ProcTable_All < Test::Unit::TestCase
|
16
|
-
def self.startup
|
17
|
-
@@windows = File::ALT_SEPARATOR
|
18
|
-
end
|
19
|
-
|
20
|
-
def setup
|
21
|
-
@pid = @@windows ? 0 : 1
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_version
|
25
|
-
assert_equal('0.9.
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_fields
|
29
|
-
assert_respond_to(ProcTable, :fields)
|
30
|
-
assert_nothing_raised{ ProcTable.fields }
|
31
|
-
assert_kind_of(Array, ProcTable.fields)
|
32
|
-
assert_kind_of(String, ProcTable.fields.first)
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_ps
|
36
|
-
assert_respond_to(ProcTable, :ps)
|
37
|
-
assert_nothing_raised{ ProcTable.ps }
|
38
|
-
assert_nothing_raised{ ProcTable.ps{} }
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_ps_with_pid
|
42
|
-
assert_nothing_raised{ ProcTable.ps(0) }
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_ps_with_explicit_nil
|
46
|
-
assert_nothing_raised{ ProcTable.ps(nil) }
|
47
|
-
assert_kind_of(Array, ProcTable.ps(nil))
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_ps_return_value
|
51
|
-
assert_kind_of(Array, ProcTable.ps)
|
52
|
-
assert_kind_of(Struct::ProcTableStruct, ProcTable.ps(@pid))
|
53
|
-
assert_equal(nil, ProcTable.ps(999999999))
|
54
|
-
assert_equal(nil, ProcTable.ps(999999999){})
|
55
|
-
assert_equal(nil, ProcTable.ps{})
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_ps_returned_struct_is_frozen
|
59
|
-
assert_true(ProcTable.ps.first.frozen?)
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_ps_expected_errors
|
63
|
-
assert_raises(TypeError){ ProcTable.ps('vim') }
|
64
|
-
omit_if(@@windows, 'ArgumentError check skipped on MS Windows')
|
65
|
-
assert_raises(ArgumentError){ ProcTable.ps(0, 'localhost') }
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_new_not_allowed
|
69
|
-
assert_raise(NoMethodError){ Sys::ProcTable.new }
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_error_class_defined
|
73
|
-
assert_not_nil(Sys::ProcTable::Error)
|
74
|
-
assert_kind_of(StandardError, Sys::ProcTable::Error.new)
|
75
|
-
end
|
76
|
-
|
77
|
-
def teardown
|
78
|
-
@pid = nil
|
79
|
-
end
|
80
|
-
|
81
|
-
def self.teardown
|
82
|
-
@@windows = nil
|
83
|
-
end
|
84
|
-
end
|
1
|
+
#######################################################################
|
2
|
+
# test_sys_proctable_all.rb
|
3
|
+
#
|
4
|
+
# Test suite for methods common to all platforms. Generally speaking
|
5
|
+
# you should run this test case using the 'rake test' task.
|
6
|
+
#######################################################################
|
7
|
+
require 'rubygems'
|
8
|
+
gem 'test-unit'
|
9
|
+
|
10
|
+
require 'test/unit'
|
11
|
+
require 'sys/proctable'
|
12
|
+
require 'test/test_sys_top'
|
13
|
+
include Sys
|
14
|
+
|
15
|
+
class TC_ProcTable_All < Test::Unit::TestCase
|
16
|
+
def self.startup
|
17
|
+
@@windows = File::ALT_SEPARATOR
|
18
|
+
end
|
19
|
+
|
20
|
+
def setup
|
21
|
+
@pid = @@windows ? 0 : 1
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_version
|
25
|
+
assert_equal('0.9.3', ProcTable::VERSION)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_fields
|
29
|
+
assert_respond_to(ProcTable, :fields)
|
30
|
+
assert_nothing_raised{ ProcTable.fields }
|
31
|
+
assert_kind_of(Array, ProcTable.fields)
|
32
|
+
assert_kind_of(String, ProcTable.fields.first)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_ps
|
36
|
+
assert_respond_to(ProcTable, :ps)
|
37
|
+
assert_nothing_raised{ ProcTable.ps }
|
38
|
+
assert_nothing_raised{ ProcTable.ps{} }
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_ps_with_pid
|
42
|
+
assert_nothing_raised{ ProcTable.ps(0) }
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_ps_with_explicit_nil
|
46
|
+
assert_nothing_raised{ ProcTable.ps(nil) }
|
47
|
+
assert_kind_of(Array, ProcTable.ps(nil))
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_ps_return_value
|
51
|
+
assert_kind_of(Array, ProcTable.ps)
|
52
|
+
assert_kind_of(Struct::ProcTableStruct, ProcTable.ps(@pid))
|
53
|
+
assert_equal(nil, ProcTable.ps(999999999))
|
54
|
+
assert_equal(nil, ProcTable.ps(999999999){})
|
55
|
+
assert_equal(nil, ProcTable.ps{})
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_ps_returned_struct_is_frozen
|
59
|
+
assert_true(ProcTable.ps.first.frozen?)
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_ps_expected_errors
|
63
|
+
assert_raises(TypeError){ ProcTable.ps('vim') }
|
64
|
+
omit_if(@@windows, 'ArgumentError check skipped on MS Windows')
|
65
|
+
assert_raises(ArgumentError){ ProcTable.ps(0, 'localhost') }
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_new_not_allowed
|
69
|
+
assert_raise(NoMethodError){ Sys::ProcTable.new }
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_error_class_defined
|
73
|
+
assert_not_nil(Sys::ProcTable::Error)
|
74
|
+
assert_kind_of(StandardError, Sys::ProcTable::Error.new)
|
75
|
+
end
|
76
|
+
|
77
|
+
def teardown
|
78
|
+
@pid = nil
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.teardown
|
82
|
+
@@windows = nil
|
83
|
+
end
|
84
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-proctable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: universal-mingw32
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|