sys-uname 0.8.5-x86-mingw32 → 0.9.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +165 -155
- data/MANIFEST +11 -11
- data/README +39 -36
- data/Rakefile +50 -61
- data/doc/uname.txt +127 -127
- data/examples/uname_test.rb +42 -41
- data/lib/unix/sys/uname.rb +327 -0
- data/lib/windows/sys/uname.rb +465 -0
- data/sys-uname.gemspec +31 -27
- data/test/test_sys_uname.rb +457 -448
- metadata +31 -61
- data/lib/sys/uname.rb +0 -471
data/sys-uname.gemspec
CHANGED
@@ -1,27 +1,31 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'sys-uname'
|
5
|
-
spec.version = '0.
|
6
|
-
spec.
|
7
|
-
spec.
|
8
|
-
spec.
|
9
|
-
spec.
|
10
|
-
spec.
|
11
|
-
spec.
|
12
|
-
spec.
|
13
|
-
|
14
|
-
|
15
|
-
spec.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'sys-uname'
|
5
|
+
spec.version = '0.9.0'
|
6
|
+
spec.author = 'Daniel J. Berger'
|
7
|
+
spec.email = 'djberg96@gmail.com'
|
8
|
+
spec.homepage = 'http://www.rubyforge.org/projects/sysutils'
|
9
|
+
spec.platform = Gem::Platform::RUBY
|
10
|
+
spec.summary = 'An interface for returning uname (platform) information'
|
11
|
+
spec.test_file = 'test/test_sys_uname.rb'
|
12
|
+
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
|
+
|
14
|
+
spec.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/uname.txt']
|
15
|
+
spec.rubyforge_project = 'sysutils'
|
16
|
+
|
17
|
+
if Config::CONFIG['host_os'] =~ /mswin|windows|dos|mingw|cygwin/i
|
18
|
+
spec.require_paths = ['lib', 'lib/windows']
|
19
|
+
else
|
20
|
+
spec.require_paths = ['lib', 'lib/unix']
|
21
|
+
spec.add_dependency('ffi', '>= 1.0.0')
|
22
|
+
end
|
23
|
+
|
24
|
+
spec.description = <<-EOF
|
25
|
+
The sys-uname library provides an interface for gathering information
|
26
|
+
about your current platform. The library is named after the Unix 'uname'
|
27
|
+
command but also works on MS Windows. Available information includes
|
28
|
+
OS name, OS version, system name and so on. Additional information is
|
29
|
+
available for certain platforms.
|
30
|
+
EOF
|
31
|
+
end
|
data/test/test_sys_uname.rb
CHANGED
@@ -1,448 +1,457 @@
|
|
1
|
-
##############################################################################
|
2
|
-
# test_sys_uname.rb
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# 'rake test' task.
|
6
|
-
##############################################################################
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
assert_respond_to(Uname, :sysname)
|
53
|
-
assert_nothing_raised{ Uname.sysname }
|
54
|
-
assert_kind_of(String, Uname.sysname
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
#
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
#
|
337
|
-
#
|
338
|
-
#
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
#
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
def
|
353
|
-
assert_nothing_raised{ Uname.uname.
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
#
|
426
|
-
#
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
1
|
+
##############################################################################
|
2
|
+
# test_sys_uname.rb
|
3
|
+
#
|
4
|
+
# Test suite for the sys-uname package. This test suite should be run via
|
5
|
+
# the 'rake test' task.
|
6
|
+
##############################################################################
|
7
|
+
gem 'test-unit'
|
8
|
+
require 'test/unit'
|
9
|
+
|
10
|
+
require 'sys/uname'
|
11
|
+
require 'rbconfig'
|
12
|
+
include Sys
|
13
|
+
|
14
|
+
class TC_Uname < Test::Unit::TestCase
|
15
|
+
def self.startup
|
16
|
+
@@host_os = RbConfig::CONFIG['host_os']
|
17
|
+
end
|
18
|
+
|
19
|
+
test "version constant is set to expected value" do
|
20
|
+
assert_equal('0.9.0', Uname::VERSION)
|
21
|
+
end
|
22
|
+
|
23
|
+
test "machine singleton method works as expected" do
|
24
|
+
assert_respond_to(Uname, :machine)
|
25
|
+
assert_nothing_raised{ Uname.machine }
|
26
|
+
assert_kind_of(String, Uname.machine)
|
27
|
+
assert_true(Uname.machine.size > 0)
|
28
|
+
end
|
29
|
+
|
30
|
+
test "version singleton method works as expected" do
|
31
|
+
assert_respond_to(Uname, :version)
|
32
|
+
assert_nothing_raised{ Uname.version }
|
33
|
+
assert_kind_of(String, Uname.version)
|
34
|
+
assert_true(Uname.version.size > 0)
|
35
|
+
end
|
36
|
+
|
37
|
+
test "nodename singleton method works as expected" do
|
38
|
+
assert_respond_to(Uname, :nodename)
|
39
|
+
assert_nothing_raised{ Uname.nodename }
|
40
|
+
assert_kind_of(String, Uname.nodename)
|
41
|
+
assert_true(Uname.nodename.size > 0)
|
42
|
+
end
|
43
|
+
|
44
|
+
test "release singleton method works as expected" do
|
45
|
+
assert_respond_to(Uname, :release)
|
46
|
+
assert_nothing_raised{ Uname.release }
|
47
|
+
assert_kind_of(String, Uname.release)
|
48
|
+
assert_true(Uname.release.size > 0)
|
49
|
+
end
|
50
|
+
|
51
|
+
test "sysname singleton method works as expected" do
|
52
|
+
assert_respond_to(Uname, :sysname)
|
53
|
+
assert_nothing_raised{ Uname.sysname }
|
54
|
+
assert_kind_of(String, Uname.sysname)
|
55
|
+
assert_true(Uname.sysname.size > 0)
|
56
|
+
end
|
57
|
+
|
58
|
+
test "architecture singleton method works as expected on solaris" do
|
59
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
60
|
+
assert_respond_to(Uname, :architecture)
|
61
|
+
assert_nothing_raised{ Uname.architecture }
|
62
|
+
assert_kind_of(String, Uname.architecture)
|
63
|
+
end
|
64
|
+
|
65
|
+
test "platform singleton method works as expected on solaris" do
|
66
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
67
|
+
assert_respond_to(Uname, :platform)
|
68
|
+
assert_nothing_raised{ Uname.platform }
|
69
|
+
assert_kind_of(String, Uname.platform)
|
70
|
+
end
|
71
|
+
|
72
|
+
test "isa_list singleton method works as expected on solaris" do
|
73
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
74
|
+
assert_respond_to(Uname, :isa_list)
|
75
|
+
assert_nothing_raised{ Uname.isa_list }
|
76
|
+
assert_kind_of(String, Uname.isa_list)
|
77
|
+
end
|
78
|
+
|
79
|
+
test "hw_provider singleton method works as expected on solaris" do
|
80
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
81
|
+
assert_respond_to(Uname,:hw_provider)
|
82
|
+
assert_nothing_raised{ Uname.hw_provider }
|
83
|
+
assert_kind_of(String, Uname.hw_provider)
|
84
|
+
end
|
85
|
+
|
86
|
+
test "hw_serial singleton method works as expected on solaris" do
|
87
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
88
|
+
assert_respond_to(Uname, :hw_serial)
|
89
|
+
assert_nothing_raised{ Uname.hw_serial }
|
90
|
+
assert_kind_of(Integer, Uname.hw_serial)
|
91
|
+
end
|
92
|
+
|
93
|
+
test "srpc_domain singleton method works as expected on solaris" do
|
94
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
95
|
+
assert_respond_to(Uname, :srpc_domain)
|
96
|
+
assert_nothing_raised{ Uname.srpc_domain }
|
97
|
+
assert_kind_of(String, Uname.srpc_domain)
|
98
|
+
end
|
99
|
+
|
100
|
+
test "dhcp_cache singleton method works as expected on solaris" do
|
101
|
+
omit_unless(@@host_os =~ /sunos|solaris/i, "Solaris only")
|
102
|
+
assert_respond_to(Uname, :dhcp_cache)
|
103
|
+
assert_nothing_raised{ Uname.dhcp_cache }
|
104
|
+
assert_kind_of(String, Uname.dhcp_cache)
|
105
|
+
end
|
106
|
+
|
107
|
+
test "model singleton method works as expected on BSD and Darwin" do
|
108
|
+
omit_unless(@@host_os =~ /darwin|powerpc|bsd|mach/i, "BSD/Darwin only")
|
109
|
+
assert_respond_to(Uname, :model)
|
110
|
+
assert_nothing_raised{ Uname.model }
|
111
|
+
assert_kind_of(String, Uname.model)
|
112
|
+
end
|
113
|
+
|
114
|
+
test "id_number singleton method works as expected on HP-UX" do
|
115
|
+
omit_unless(@@host_os =~ /hpux/i, "HP-UX only")
|
116
|
+
assert_respond_to(Uname, :id_number)
|
117
|
+
assert_nothing_raised{ Uname.id_number }
|
118
|
+
assert_kind_of(String, Uname.id_number)
|
119
|
+
end
|
120
|
+
|
121
|
+
test "uname struct contains expected members based on platform" do
|
122
|
+
members = %w/sysname nodename machine version release/
|
123
|
+
case RbConfig::CONFIG['host_os']
|
124
|
+
when /linux/i
|
125
|
+
members.push('domainname')
|
126
|
+
when /sunos|solaris/i
|
127
|
+
members.push(
|
128
|
+
'architecture', 'platform', 'hw_serial', 'hw_provider',
|
129
|
+
'srpc_domain', 'isa_list', 'dhcp_cache'
|
130
|
+
)
|
131
|
+
when /powerpc|darwin|bsd/i
|
132
|
+
members.push('model')
|
133
|
+
when /hpux/i
|
134
|
+
members.push('id')
|
135
|
+
when /win32|mingw|cygwin|dos|windows/i
|
136
|
+
members = %w[
|
137
|
+
boot_device build_number build_type caption code_set country_code
|
138
|
+
creation_class_name cscreation_class_name csd_version cs_name
|
139
|
+
current_time_zone debug description distributed
|
140
|
+
foreground_application_boost free_physical_memory
|
141
|
+
free_space_in_paging_files free_virtual_memory
|
142
|
+
install_date last_bootup_time local_date_time locale
|
143
|
+
manufacturer max_number_of_processes max_process_memory_size
|
144
|
+
name number_of_licensed_users number_of_processes
|
145
|
+
number_of_users organization os_language os_product_suite
|
146
|
+
os_type other_type_description plus_product_id
|
147
|
+
plus_version_number primary quantum_length quantum_type
|
148
|
+
registered_user serial_number service_pack_major_version
|
149
|
+
service_pack_minor_version size_stored_in_paging_files
|
150
|
+
status system_device system_directory total_swap_space_size
|
151
|
+
total_virtual_memory_size total_visible_memory_size version
|
152
|
+
windows_directory
|
153
|
+
]
|
154
|
+
end
|
155
|
+
|
156
|
+
members.map!{ |e| e.to_sym } if RUBY_VERSION.to_f >= 1.9
|
157
|
+
|
158
|
+
assert_nothing_raised{ Uname.uname }
|
159
|
+
assert_kind_of(Struct, Uname.uname)
|
160
|
+
assert_equal(members.sort, Uname.uname.members.sort)
|
161
|
+
end
|
162
|
+
|
163
|
+
# The following tests are win32 only
|
164
|
+
if File::ALT_SEPARATOR
|
165
|
+
def test_boot_device
|
166
|
+
assert_nothing_raised{ Uname.uname.boot_device }
|
167
|
+
assert_kind_of(String, Uname.uname.boot_device)
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_build_number
|
171
|
+
assert_nothing_raised{ Uname.uname.build_number }
|
172
|
+
assert_kind_of(String, Uname.uname.build_number)
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_build_type
|
176
|
+
assert_nothing_raised{ Uname.uname.build_type }
|
177
|
+
assert_kind_of(String, Uname.uname.build_type)
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_caption
|
181
|
+
assert_nothing_raised{ Uname.uname.caption }
|
182
|
+
assert_kind_of(String, Uname.uname.caption)
|
183
|
+
end
|
184
|
+
|
185
|
+
def test_code_set
|
186
|
+
assert_nothing_raised{ Uname.uname.code_set }
|
187
|
+
assert_kind_of(String, Uname.uname.code_set)
|
188
|
+
end
|
189
|
+
|
190
|
+
def test_country_code
|
191
|
+
assert_nothing_raised{ Uname.uname.country_code }
|
192
|
+
assert_kind_of(String, Uname.uname.country_code)
|
193
|
+
end
|
194
|
+
|
195
|
+
def test_creation_class_name
|
196
|
+
assert_nothing_raised{ Uname.uname.creation_class_name }
|
197
|
+
assert_kind_of(String, Uname.uname.creation_class_name)
|
198
|
+
end
|
199
|
+
|
200
|
+
def test_cscreation_class_name
|
201
|
+
assert_nothing_raised{ Uname.uname.cscreation_class_name }
|
202
|
+
assert_kind_of(String, Uname.uname.cscreation_class_name)
|
203
|
+
end
|
204
|
+
|
205
|
+
def test_csd_version
|
206
|
+
assert_nothing_raised{ Uname.uname.csd_version }
|
207
|
+
assert_kind_of(String, Uname.uname.csd_version)
|
208
|
+
end
|
209
|
+
|
210
|
+
def test_cs_name
|
211
|
+
assert_nothing_raised{ Uname.uname.cs_name }
|
212
|
+
assert_kind_of(String, Uname.uname.cs_name)
|
213
|
+
end
|
214
|
+
|
215
|
+
def test_current_time_zone
|
216
|
+
assert_nothing_raised{ Uname.uname.current_time_zone }
|
217
|
+
assert_kind_of(Fixnum, Uname.uname.current_time_zone)
|
218
|
+
end
|
219
|
+
|
220
|
+
def test_debug
|
221
|
+
assert_nothing_raised{ Uname.uname.debug }
|
222
|
+
assert_boolean(Uname.uname.debug)
|
223
|
+
end
|
224
|
+
|
225
|
+
def test_description
|
226
|
+
assert_nothing_raised{ Uname.uname.description }
|
227
|
+
assert_kind_of(String, Uname.uname.description)
|
228
|
+
end
|
229
|
+
|
230
|
+
def test_distributed
|
231
|
+
assert_nothing_raised{ Uname.uname.distributed }
|
232
|
+
assert_boolean(Uname.uname.distributed)
|
233
|
+
end
|
234
|
+
|
235
|
+
# Not yet supported - WinXP or later only
|
236
|
+
#def test_encryption_level
|
237
|
+
# assert_nothing_raised{ Uname.uname.encryption_level }
|
238
|
+
# assert_kind_of(Fixnum,Uname.uname.encryption_level)
|
239
|
+
#end
|
240
|
+
|
241
|
+
def test_foreground_application_boost
|
242
|
+
assert_nothing_raised{ Uname.uname.foreground_application_boost }
|
243
|
+
assert_kind_of(Fixnum, Uname.uname.foreground_application_boost)
|
244
|
+
end
|
245
|
+
|
246
|
+
def test_free_physical_memory
|
247
|
+
assert_nothing_raised{ Uname.uname.free_physical_memory }
|
248
|
+
assert_kind_of(Fixnum, Uname.uname.free_physical_memory)
|
249
|
+
end
|
250
|
+
|
251
|
+
def test_free_space_in_paging_files
|
252
|
+
assert_nothing_raised{ Uname.uname.free_space_in_paging_files }
|
253
|
+
assert_kind_of(Fixnum, Uname.uname.free_space_in_paging_files)
|
254
|
+
end
|
255
|
+
|
256
|
+
def test_free_virtual_memory
|
257
|
+
assert_nothing_raised{ Uname.uname.free_virtual_memory}
|
258
|
+
assert_kind_of(Fixnum, Uname.uname.free_virtual_memory)
|
259
|
+
end
|
260
|
+
|
261
|
+
def test_install_date
|
262
|
+
assert_nothing_raised{ Uname.uname.install_date}
|
263
|
+
assert_kind_of(Time, Uname.uname.install_date)
|
264
|
+
end
|
265
|
+
|
266
|
+
# Not yet supported - WinXP or later only
|
267
|
+
#def test_large_system_cache
|
268
|
+
# assert_nothing_raised{ Uname.uname.large_system_cache}
|
269
|
+
# assert_kind_of(Time,Uname.uname.large_system_cache)
|
270
|
+
#end
|
271
|
+
|
272
|
+
def test_last_bootup_time
|
273
|
+
assert_nothing_raised{ Uname.uname.last_bootup_time}
|
274
|
+
assert_kind_of(Time, Uname.uname.last_bootup_time)
|
275
|
+
end
|
276
|
+
|
277
|
+
def test_local_date_time
|
278
|
+
assert_nothing_raised{ Uname.uname.local_date_time}
|
279
|
+
assert_kind_of(Time, Uname.uname.local_date_time)
|
280
|
+
end
|
281
|
+
|
282
|
+
def test_locale
|
283
|
+
assert_nothing_raised{ Uname.uname.locale}
|
284
|
+
assert_kind_of(String, Uname.uname.locale)
|
285
|
+
end
|
286
|
+
|
287
|
+
def test_manufacturer
|
288
|
+
assert_nothing_raised{ Uname.uname.manufacturer}
|
289
|
+
assert_kind_of(String, Uname.uname.manufacturer)
|
290
|
+
end
|
291
|
+
|
292
|
+
def test_max_number_of_processes
|
293
|
+
assert_nothing_raised{ Uname.uname.max_number_of_processes}
|
294
|
+
assert_kind_of(Fixnum, Uname.uname.max_number_of_processes)
|
295
|
+
end
|
296
|
+
|
297
|
+
def test_max_process_memory_size
|
298
|
+
assert_nothing_raised{ Uname.uname.max_process_memory_size}
|
299
|
+
assert_kind_of(Integer, Uname.uname.max_process_memory_size)
|
300
|
+
end
|
301
|
+
|
302
|
+
def test_name
|
303
|
+
assert_nothing_raised{ Uname.uname.name}
|
304
|
+
assert_kind_of(String, Uname.uname.name)
|
305
|
+
end
|
306
|
+
|
307
|
+
# Fails on Win XP Pro - returns nil - reason unknown
|
308
|
+
#def test_number_of_licensed_users
|
309
|
+
# assert_nothing_raised{ Uname.uname.number_of_licensed_users}
|
310
|
+
# assert_kind_of(Fixnum,Uname.uname.number_of_licensed_users)
|
311
|
+
#end
|
312
|
+
|
313
|
+
def test_number_of_processes
|
314
|
+
assert_nothing_raised{ Uname.uname.number_of_processes}
|
315
|
+
assert_kind_of(Fixnum, Uname.uname.number_of_processes)
|
316
|
+
end
|
317
|
+
|
318
|
+
def test_number_of_users
|
319
|
+
assert_nothing_raised{ Uname.uname.number_of_users}
|
320
|
+
assert_kind_of(Fixnum, Uname.uname.number_of_users)
|
321
|
+
end
|
322
|
+
|
323
|
+
def test_organization
|
324
|
+
assert_nothing_raised{ Uname.uname.organization}
|
325
|
+
assert_kind_of(String, Uname.uname.organization)
|
326
|
+
end
|
327
|
+
|
328
|
+
# Eventually replace Fixnum with a string (?)
|
329
|
+
def test_os_language
|
330
|
+
assert_nothing_raised{ Uname.uname.os_language}
|
331
|
+
assert_kind_of(Fixnum, Uname.uname.os_language)
|
332
|
+
end
|
333
|
+
|
334
|
+
# Fails on Win XP Pro - returns nil - reason unknown
|
335
|
+
#def test_os_product_suite
|
336
|
+
# assert_nothing_raised{ Uname.uname.os_product_suite}
|
337
|
+
# assert_kind_of(Fixnum,Uname.uname.os_product_suite)
|
338
|
+
#end
|
339
|
+
|
340
|
+
def test_os_type
|
341
|
+
assert_nothing_raised{ Uname.uname.os_type}
|
342
|
+
assert_kind_of(Fixnum, Uname.uname.os_type)
|
343
|
+
end
|
344
|
+
|
345
|
+
# Fails?
|
346
|
+
#def test_other_type_restriction
|
347
|
+
# assert_nothing_raised{ Uname.uname.other_type_restriction}
|
348
|
+
# assert_kind_of(Fixnum,Uname.uname.other_type_restriction)
|
349
|
+
#end
|
350
|
+
|
351
|
+
# Might be nil
|
352
|
+
def test_plus_product_id
|
353
|
+
assert_nothing_raised{ Uname.uname.plus_product_id }
|
354
|
+
end
|
355
|
+
|
356
|
+
# Might be nil
|
357
|
+
def test_plus_version_number
|
358
|
+
assert_nothing_raised{ Uname.uname.plus_version_number}
|
359
|
+
end
|
360
|
+
|
361
|
+
def test_primary
|
362
|
+
assert_nothing_raised{ Uname.uname.primary}
|
363
|
+
assert_boolean(Uname.uname.primary)
|
364
|
+
end
|
365
|
+
|
366
|
+
# Not yet supported - WinXP or later only
|
367
|
+
# def test_product_type
|
368
|
+
# assert_nothing_raised{ Uname.uname.product_type}
|
369
|
+
# assert_kind_of(Fixnum,Uname.uname.product_type)
|
370
|
+
# end
|
371
|
+
|
372
|
+
def test_quantum_length
|
373
|
+
assert_nothing_raised{ Uname.uname.quantum_length}
|
374
|
+
assert_kind_of(Fixnum, Uname.uname.quantum_length)
|
375
|
+
end
|
376
|
+
|
377
|
+
def test_quantum_type
|
378
|
+
assert_nothing_raised{ Uname.uname.quantum_type}
|
379
|
+
assert_kind_of(Fixnum, Uname.uname.quantum_type)
|
380
|
+
end
|
381
|
+
|
382
|
+
def test_registered_user
|
383
|
+
assert_nothing_raised{ Uname.uname.registered_user}
|
384
|
+
assert_kind_of(String, Uname.uname.registered_user)
|
385
|
+
end
|
386
|
+
|
387
|
+
def test_serial_number
|
388
|
+
assert_nothing_raised{ Uname.uname.serial_number}
|
389
|
+
assert_kind_of(String, Uname.uname.serial_number)
|
390
|
+
end
|
391
|
+
|
392
|
+
# This is nil on NT 4
|
393
|
+
def test_service_pack_major_version
|
394
|
+
assert_nothing_raised{ Uname.uname.service_pack_major_version}
|
395
|
+
assert_kind_of(Fixnum, Uname.uname.service_pack_major_version)
|
396
|
+
end
|
397
|
+
|
398
|
+
# This is nil on NT 4
|
399
|
+
def test_service_pack_minor_version
|
400
|
+
assert_nothing_raised{ Uname.uname.service_pack_minor_version}
|
401
|
+
assert_kind_of(Fixnum, Uname.uname.service_pack_minor_version)
|
402
|
+
end
|
403
|
+
|
404
|
+
def test_status
|
405
|
+
assert_nothing_raised{ Uname.uname.status}
|
406
|
+
assert_kind_of(String, Uname.uname.status)
|
407
|
+
end
|
408
|
+
|
409
|
+
# Not yet supported - WinXP or later only
|
410
|
+
#def test_suite_mask
|
411
|
+
# assert_nothing_raised{ Uname.uname.suite_mask}
|
412
|
+
# assert_kind_of(String,Uname.uname.suite_mask)
|
413
|
+
#end
|
414
|
+
|
415
|
+
def test_system_device
|
416
|
+
assert_nothing_raised{ Uname.uname.system_device}
|
417
|
+
assert_kind_of(String, Uname.uname.system_device)
|
418
|
+
end
|
419
|
+
|
420
|
+
def test_system_directory
|
421
|
+
assert_nothing_raised{ Uname.uname.system_directory}
|
422
|
+
assert_kind_of(String, Uname.uname.system_directory)
|
423
|
+
end
|
424
|
+
|
425
|
+
# Not yet supported - WinXP or later only
|
426
|
+
#def test_system_drive
|
427
|
+
# assert_nothing_raised{ Uname.uname.system_drive}
|
428
|
+
# assert_kind_of(String,Uname.uname.system_drive)
|
429
|
+
#end
|
430
|
+
|
431
|
+
# Fails on Win XP Pro - returns nil - reason unknown
|
432
|
+
#def test_total_swap_space_size
|
433
|
+
# assert_nothing_raised{ Uname.uname.total_swap_space_size}
|
434
|
+
# assert_kind_of(Fixnum,Uname.uname.total_swap_space_size)
|
435
|
+
#end
|
436
|
+
|
437
|
+
def test_total_virtual_memory_size
|
438
|
+
assert_nothing_raised{ Uname.uname.total_virtual_memory_size}
|
439
|
+
assert_kind_of(Fixnum, Uname.uname.total_virtual_memory_size)
|
440
|
+
end
|
441
|
+
|
442
|
+
def test_total_visible_memory_size
|
443
|
+
assert_nothing_raised{ Uname.uname.total_visible_memory_size}
|
444
|
+
assert_kind_of(Fixnum, Uname.uname.total_visible_memory_size)
|
445
|
+
end
|
446
|
+
|
447
|
+
def test_version
|
448
|
+
assert_nothing_raised{ Uname.uname.version}
|
449
|
+
assert_kind_of(String, Uname.uname.version)
|
450
|
+
end
|
451
|
+
|
452
|
+
def test_windows_directory
|
453
|
+
assert_nothing_raised{ Uname.uname.windows_directory}
|
454
|
+
assert_kind_of(String, Uname.uname.windows_directory)
|
455
|
+
end
|
456
|
+
end
|
457
|
+
end
|