sys-uname 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +11 -0
- data/Gemfile +2 -7
- data/README.md +9 -8
- data/Rakefile +4 -2
- data/doc/uname.rdoc +3 -35
- data/examples/uname_test.rb +1 -13
- data/lib/sys/platform.rb +15 -18
- data/lib/sys/uname.rb +3 -1
- data/lib/sys/unix/uname.rb +23 -84
- data/lib/sys/windows/uname.rb +222 -238
- data/lib/sys-uname.rb +2 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/sys_platform_spec.rb +32 -43
- data/spec/sys_uname_spec.rb +186 -232
- data/sys-uname.gemspec +11 -7
- data.tar.gz.sig +0 -0
- metadata +36 -5
- metadata.gz.sig +0 -0
data/spec/sys_uname_spec.rb
CHANGED
@@ -1,445 +1,399 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
##############################################################################
|
2
4
|
# sys_uname_spec.rb
|
3
5
|
#
|
4
6
|
# Test suite for the sys-uname library. Run 'rake test' to execute tests.
|
5
7
|
##############################################################################
|
6
|
-
require '
|
7
|
-
require 'sys/uname'
|
8
|
-
require 'rbconfig'
|
8
|
+
require 'spec_helper'
|
9
9
|
|
10
10
|
RSpec.describe Sys::Uname do
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
let(:members){ %i[sysname nodename machine version release] }
|
12
|
+
let(:windows_members) do
|
13
|
+
%i[
|
14
|
+
boot_device build_number build_type caption code_set country_code creation_class_name
|
15
|
+
cscreation_class_name csd_version cs_name current_time_zone debug description distributed
|
16
|
+
encryption_level foreground_application_boost free_physical_memory free_space_in_paging_files
|
17
|
+
free_virtual_memory install_date last_bootup_time local_date_time locale manufacturer
|
18
|
+
max_number_of_processes max_process_memory_size name number_of_licensed_users number_of_processes
|
19
|
+
number_of_users organization os_language os_product_suite os_type other_type_description plus_product_id
|
20
|
+
plus_version_number primary product_type quantum_length quantum_type registered_user serial_number
|
21
|
+
service_pack_major_version service_pack_minor_version size_stored_in_paging_files
|
22
|
+
status suite_mask system_device system_directory system_drive total_swap_space_size
|
23
|
+
total_virtual_memory_size total_visible_memory_size version windows_directory
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'universal singleton methods' do
|
28
|
+
example 'version constant is set to expected value' do
|
29
|
+
expect(Sys::Uname::VERSION).to eql('1.3.0')
|
14
30
|
expect(Sys::Uname::VERSION).to be_frozen
|
15
31
|
end
|
16
32
|
|
17
|
-
example
|
33
|
+
example 'uname basic functionality' do
|
34
|
+
expect{ described_class.uname }.not_to raise_error
|
35
|
+
expect(described_class.uname).to be_a(Struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
example 'machine singleton method works as expected' do
|
18
39
|
expect(described_class).to respond_to(:machine)
|
19
40
|
expect{ described_class.machine }.not_to raise_error
|
20
|
-
expect(described_class.machine).to
|
41
|
+
expect(described_class.machine).to be_a(String)
|
21
42
|
expect(described_class.machine.size).to be > 0
|
22
43
|
end
|
23
44
|
|
24
|
-
example
|
45
|
+
example 'version singleton method works as expected' do
|
25
46
|
expect(described_class).to respond_to(:version)
|
26
47
|
expect{ described_class.version }.not_to raise_error
|
27
|
-
expect(described_class.version).to
|
48
|
+
expect(described_class.version).to be_a(String)
|
28
49
|
expect(described_class.version.size).to be > 0
|
29
50
|
end
|
30
51
|
|
31
|
-
example
|
52
|
+
example 'nodename singleton method works as expected' do
|
32
53
|
expect(described_class).to respond_to(:nodename)
|
33
54
|
expect{ described_class.nodename }.not_to raise_error
|
34
|
-
expect(described_class.nodename).to
|
35
|
-
expect(described_class.nodename.size).to be > 0
|
55
|
+
expect(described_class.nodename).to be_a(String)
|
36
56
|
end
|
37
57
|
|
38
|
-
example
|
58
|
+
example 'release singleton method works as expected' do
|
39
59
|
expect(described_class).to respond_to(:release)
|
40
60
|
expect{ described_class.release }.not_to raise_error
|
41
|
-
expect(described_class.release).to
|
61
|
+
expect(described_class.release).to be_a(String)
|
42
62
|
expect(described_class.release.size).to be > 0
|
43
63
|
end
|
44
64
|
|
45
|
-
example
|
65
|
+
example 'sysname singleton method works as expected' do
|
46
66
|
expect(described_class).to respond_to(:sysname)
|
47
67
|
expect{ described_class.sysname }.not_to raise_error
|
48
|
-
expect(described_class.sysname).to
|
68
|
+
expect(described_class.sysname).to be_a(String)
|
49
69
|
expect(described_class.sysname.size).to be > 0
|
50
70
|
end
|
51
71
|
end
|
52
72
|
|
53
|
-
context
|
54
|
-
example
|
55
|
-
expect(described_class).to respond_to(:architecture)
|
56
|
-
expect{ described_class.architecture }.not_to raise_error
|
57
|
-
expect(described_class.architecture).to be_kind_of(String)
|
58
|
-
end
|
59
|
-
|
60
|
-
example "platform singleton method works as expected on solaris" do
|
61
|
-
expect(described_class).to respond_to(:platform)
|
62
|
-
expect{ described_class.platform }.not_to raise_error
|
63
|
-
expect(described_class.platform).to be_kind_of(String)
|
64
|
-
end
|
65
|
-
|
66
|
-
example "isa_list singleton method works as expected on solaris" do
|
67
|
-
expect(described_class).to respond_to(:isa_list)
|
68
|
-
expect{ described_class.isa_list }.not_to raise_error
|
69
|
-
expect(described_class.isa_list).to be_kind_of(String)
|
70
|
-
end
|
71
|
-
|
72
|
-
example "hw_provider singleton method works as expected on solaris" do
|
73
|
-
expect(described_class).to respond_to(:hw_provider)
|
74
|
-
expect{ described_class.hw_provider }.not_to raise_error
|
75
|
-
expect(described_class.hw_provider).to be_kind_of(String)
|
76
|
-
end
|
77
|
-
|
78
|
-
example "hw_serial singleton method works as expected on solaris" do
|
79
|
-
expect(described_class).to respond_to(:hw_serial)
|
80
|
-
expect{ described_class.hw_serial }.not_to raise_error
|
81
|
-
expect(described_class.hw_serial).to be_kind_of(Integer)
|
82
|
-
end
|
83
|
-
|
84
|
-
example "srpc_domain singleton method works as expected on solaris" do
|
85
|
-
expect(described_class).to respond_to(:srpc_domain)
|
86
|
-
expect{ described_class.srpc_domain }.not_to raise_error
|
87
|
-
expect(described_class.srpc_domain).to be_kind_of(String)
|
88
|
-
end
|
89
|
-
|
90
|
-
example "dhcp_cache singleton method works as expected on solaris" do
|
91
|
-
expect(described_class).to respond_to(:dhcp_cache)
|
92
|
-
expect{ described_class.dhcp_cache }.not_to raise_error
|
93
|
-
expect(described_class.dhcp_cache).to be_kind_of(String)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
context "singleton methods for BSD and Darwin only", :if => RbConfig::CONFIG['host_os'] =~ /darwin|bsd/i do
|
98
|
-
example "model singleton method works as expected on BSD and Darwin" do
|
73
|
+
context 'singleton methods for BSD and Darwin only', :bsd do
|
74
|
+
example 'model singleton method works as expected on BSD and Darwin' do
|
99
75
|
expect(described_class).to respond_to(:model)
|
100
76
|
expect{ described_class.model }.not_to raise_error
|
101
|
-
expect(described_class.model).to
|
77
|
+
expect(described_class.model).to be_a(String)
|
102
78
|
end
|
103
79
|
end
|
104
80
|
|
105
|
-
context
|
106
|
-
example
|
81
|
+
context 'singleton methods for HP-UX only', :hpux do
|
82
|
+
example 'id_number singleton method works as expected on HP-UX' do
|
107
83
|
expect(described_class).to respond_to(:id_number)
|
108
84
|
expect{ described_class.id_number }.not_to raise_error
|
109
|
-
expect(described_class.id_number).to
|
85
|
+
expect(described_class.id_number).to be_a(String)
|
110
86
|
end
|
111
87
|
end
|
112
88
|
|
113
|
-
context
|
114
|
-
example
|
115
|
-
members
|
116
|
-
|
117
|
-
|
118
|
-
members.push('domainname')
|
119
|
-
when /sunos|solaris/i
|
120
|
-
members.push(
|
121
|
-
'architecture', 'platform', 'hw_serial', 'hw_provider',
|
122
|
-
'srpc_domain', 'isa_list', 'dhcp_cache'
|
123
|
-
)
|
124
|
-
when /powerpc|darwin|bsd/i
|
125
|
-
members.push('model')
|
126
|
-
when /hpux/i
|
127
|
-
members.push('id')
|
128
|
-
when /win32|mingw|cygwin|dos|windows/i
|
129
|
-
members = %w[
|
130
|
-
boot_device build_number build_type caption code_set country_code
|
131
|
-
creation_class_name cscreation_class_name csd_version cs_name
|
132
|
-
current_time_zone debug description distributed encryption_level
|
133
|
-
foreground_application_boost free_physical_memory
|
134
|
-
free_space_in_paging_files free_virtual_memory
|
135
|
-
install_date last_bootup_time local_date_time locale
|
136
|
-
manufacturer max_number_of_processes max_process_memory_size
|
137
|
-
name number_of_licensed_users number_of_processes
|
138
|
-
number_of_users organization os_language os_product_suite
|
139
|
-
os_type other_type_description plus_product_id
|
140
|
-
plus_version_number primary product_type quantum_length quantum_type
|
141
|
-
registered_user serial_number service_pack_major_version
|
142
|
-
service_pack_minor_version size_stored_in_paging_files
|
143
|
-
status suite_mask system_device system_directory system_drive total_swap_space_size
|
144
|
-
total_virtual_memory_size total_visible_memory_size version
|
145
|
-
windows_directory
|
146
|
-
]
|
147
|
-
end
|
148
|
-
|
149
|
-
members.map!{ |e| e.to_sym } if RUBY_VERSION.to_f >= 1.9
|
89
|
+
context 'uname struct' do
|
90
|
+
example 'uname struct contains expected members on linux', :linux do
|
91
|
+
members.push(:domainname)
|
92
|
+
expect(described_class.uname.members.sort).to eql(members.sort)
|
93
|
+
end
|
150
94
|
|
151
|
-
|
152
|
-
|
95
|
+
example 'uname struct contains expected members on bsd or osx', :bsd do
|
96
|
+
members.push(:model)
|
97
|
+
expect(described_class.uname.members.sort).to eql(members.sort)
|
98
|
+
end
|
99
|
+
|
100
|
+
example 'uname struct contains expected members on hpux', :hpux do
|
101
|
+
members.push(:id)
|
153
102
|
expect(described_class.uname.members.sort).to eql(members.sort)
|
154
103
|
end
|
104
|
+
|
105
|
+
example 'uname struct contains expected members on windows', :windows do
|
106
|
+
expect(described_class.uname.members.sort).to eql(windows_members.sort)
|
107
|
+
end
|
155
108
|
end
|
156
109
|
|
157
|
-
context
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
expect(
|
162
|
-
expect(
|
163
|
-
expect(
|
164
|
-
expect(
|
110
|
+
context 'ffi' do
|
111
|
+
let(:our_methods){ described_class.methods(false).map(&:to_s) }
|
112
|
+
|
113
|
+
example 'ffi and internal functions are not public' do
|
114
|
+
expect(our_methods).not_to include('get_model')
|
115
|
+
expect(our_methods).not_to include('get_si')
|
116
|
+
expect(our_methods).not_to include('uname_c')
|
117
|
+
expect(our_methods).not_to include('sysctl')
|
118
|
+
expect(our_methods).not_to include('sysinfo')
|
165
119
|
end
|
166
120
|
end
|
167
121
|
|
168
|
-
context
|
169
|
-
example
|
122
|
+
context 'instance methods for MS Windows', :if => File::ALT_SEPARATOR do
|
123
|
+
example 'boot_device' do
|
170
124
|
expect{ described_class.uname.boot_device }.not_to raise_error
|
171
|
-
expect(described_class.uname.boot_device).to
|
125
|
+
expect(described_class.uname.boot_device).to be_a(String)
|
172
126
|
end
|
173
127
|
|
174
|
-
example
|
128
|
+
example 'build_number' do
|
175
129
|
expect{ described_class.uname.build_number }.not_to raise_error
|
176
|
-
expect(described_class.uname.build_number).to
|
130
|
+
expect(described_class.uname.build_number).to be_a(String)
|
177
131
|
end
|
178
132
|
|
179
|
-
example
|
133
|
+
example 'build_type' do
|
180
134
|
expect{ described_class.uname.build_type }.not_to raise_error
|
181
|
-
expect(described_class.uname.build_type).to
|
135
|
+
expect(described_class.uname.build_type).to be_a(String)
|
182
136
|
end
|
183
137
|
|
184
|
-
example
|
138
|
+
example 'caption' do
|
185
139
|
expect{ described_class.uname.caption }.not_to raise_error
|
186
|
-
expect(described_class.uname.caption).to
|
140
|
+
expect(described_class.uname.caption).to be_a(String)
|
187
141
|
end
|
188
142
|
|
189
|
-
example
|
143
|
+
example 'code_set' do
|
190
144
|
expect{ described_class.uname.code_set }.not_to raise_error
|
191
|
-
expect(described_class.uname.code_set).to
|
145
|
+
expect(described_class.uname.code_set).to be_a(String)
|
192
146
|
end
|
193
147
|
|
194
|
-
example
|
148
|
+
example 'country_code' do
|
195
149
|
expect{ described_class.uname.country_code }.not_to raise_error
|
196
|
-
expect(described_class.uname.country_code).to
|
150
|
+
expect(described_class.uname.country_code).to be_a(String)
|
197
151
|
end
|
198
152
|
|
199
|
-
example
|
153
|
+
example 'creation_class_name' do
|
200
154
|
expect{ described_class.uname.creation_class_name }.not_to raise_error
|
201
|
-
expect(described_class.uname.creation_class_name).to
|
155
|
+
expect(described_class.uname.creation_class_name).to be_a(String)
|
202
156
|
end
|
203
157
|
|
204
|
-
example
|
158
|
+
example 'cscreation_class_name' do
|
205
159
|
expect{ described_class.uname.cscreation_class_name }.not_to raise_error
|
206
|
-
expect(described_class.uname.cscreation_class_name).to
|
160
|
+
expect(described_class.uname.cscreation_class_name).to be_a(String)
|
207
161
|
end
|
208
162
|
|
209
|
-
example
|
163
|
+
example 'csd_version' do
|
210
164
|
expect{ described_class.uname.csd_version }.not_to raise_error
|
211
|
-
expect(described_class.uname.csd_version).to
|
165
|
+
expect(described_class.uname.csd_version).to be_a(String).or be_nil
|
212
166
|
end
|
213
167
|
|
214
|
-
example
|
168
|
+
example 'cs_name' do
|
215
169
|
expect{ described_class.uname.cs_name }.not_to raise_error
|
216
|
-
expect(described_class.uname.cs_name).to
|
170
|
+
expect(described_class.uname.cs_name).to be_a(String)
|
217
171
|
end
|
218
172
|
|
219
|
-
example
|
173
|
+
example 'current_time_zone' do
|
220
174
|
expect{ described_class.uname.current_time_zone }.not_to raise_error
|
221
|
-
expect(described_class.uname.current_time_zone).to
|
175
|
+
expect(described_class.uname.current_time_zone).to be_a(Integer)
|
222
176
|
end
|
223
177
|
|
224
|
-
example
|
178
|
+
example 'debug' do
|
225
179
|
expect{ described_class.uname.debug }.not_to raise_error
|
226
180
|
expect(described_class.uname.debug).to be(true).or be(false)
|
227
181
|
end
|
228
182
|
|
229
|
-
example
|
183
|
+
example 'description' do
|
230
184
|
expect{ described_class.uname.description }.not_to raise_error
|
231
|
-
expect(described_class.uname.description).to
|
185
|
+
expect(described_class.uname.description).to be_a(String)
|
232
186
|
end
|
233
187
|
|
234
|
-
example
|
188
|
+
example 'distributed' do
|
235
189
|
expect{ described_class.uname.distributed }.not_to raise_error
|
236
190
|
expect(described_class.uname.distributed).to be(true).or be(false)
|
237
191
|
end
|
238
192
|
|
239
|
-
example
|
193
|
+
example 'encryption_level' do
|
240
194
|
expect{ described_class.uname.encryption_level }.not_to raise_error
|
241
|
-
expect(described_class.uname.encryption_level).to
|
195
|
+
expect(described_class.uname.encryption_level).to be_a(Integer)
|
242
196
|
end
|
243
197
|
|
244
|
-
example
|
198
|
+
example 'foreground_application_boost' do
|
245
199
|
expect{ described_class.uname.foreground_application_boost }.not_to raise_error
|
246
|
-
expect(described_class.uname.foreground_application_boost).to
|
200
|
+
expect(described_class.uname.foreground_application_boost).to be_a(Integer)
|
247
201
|
end
|
248
202
|
|
249
|
-
example
|
203
|
+
example 'free_physical_memory' do
|
250
204
|
expect{ described_class.uname.free_physical_memory }.not_to raise_error
|
251
|
-
expect(described_class.uname.free_physical_memory).to
|
205
|
+
expect(described_class.uname.free_physical_memory).to be_a(Integer)
|
252
206
|
end
|
253
207
|
|
254
|
-
example
|
208
|
+
example 'free_space_in_paging_files' do
|
255
209
|
expect{ described_class.uname.free_space_in_paging_files }.not_to raise_error
|
256
|
-
expect(described_class.uname.free_space_in_paging_files).to
|
210
|
+
expect(described_class.uname.free_space_in_paging_files).to be_a(Integer)
|
257
211
|
end
|
258
212
|
|
259
|
-
example
|
260
|
-
expect{ described_class.uname.free_virtual_memory}.not_to raise_error
|
261
|
-
expect(described_class.uname.free_virtual_memory).to
|
213
|
+
example 'free_virtual_memory' do
|
214
|
+
expect{ described_class.uname.free_virtual_memory }.not_to raise_error
|
215
|
+
expect(described_class.uname.free_virtual_memory).to be_a(Integer)
|
262
216
|
end
|
263
217
|
|
264
|
-
example
|
265
|
-
expect{ described_class.uname.install_date}.not_to raise_error
|
266
|
-
expect(described_class.uname.install_date).to
|
218
|
+
example 'install_date' do
|
219
|
+
expect{ described_class.uname.install_date }.not_to raise_error
|
220
|
+
expect(described_class.uname.install_date).to be_a(Time)
|
267
221
|
end
|
268
222
|
|
269
|
-
example
|
270
|
-
expect{ described_class.uname.last_bootup_time}.not_to raise_error
|
271
|
-
expect(described_class.uname.last_bootup_time).to
|
223
|
+
example 'last_bootup_time' do
|
224
|
+
expect{ described_class.uname.last_bootup_time }.not_to raise_error
|
225
|
+
expect(described_class.uname.last_bootup_time).to be_a(Time)
|
272
226
|
end
|
273
227
|
|
274
|
-
example
|
275
|
-
expect{ described_class.uname.local_date_time}.not_to raise_error
|
276
|
-
expect(described_class.uname.local_date_time).to
|
228
|
+
example 'local_date_time' do
|
229
|
+
expect{ described_class.uname.local_date_time }.not_to raise_error
|
230
|
+
expect(described_class.uname.local_date_time).to be_a(Time)
|
277
231
|
end
|
278
232
|
|
279
|
-
example
|
280
|
-
expect{ described_class.uname.locale}.not_to raise_error
|
281
|
-
expect(described_class.uname.locale).to
|
233
|
+
example 'locale' do
|
234
|
+
expect{ described_class.uname.locale }.not_to raise_error
|
235
|
+
expect(described_class.uname.locale).to be_a(String)
|
282
236
|
end
|
283
237
|
|
284
|
-
example
|
285
|
-
expect{ described_class.uname.manufacturer}.not_to raise_error
|
286
|
-
expect(described_class.uname.manufacturer).to
|
238
|
+
example 'manufacturer' do
|
239
|
+
expect{ described_class.uname.manufacturer }.not_to raise_error
|
240
|
+
expect(described_class.uname.manufacturer).to be_a(String)
|
287
241
|
end
|
288
242
|
|
289
|
-
example
|
290
|
-
expect{ described_class.uname.max_number_of_processes}.not_to raise_error
|
291
|
-
expect(described_class.uname.max_number_of_processes).to
|
243
|
+
example 'max_number_of_processes' do
|
244
|
+
expect{ described_class.uname.max_number_of_processes }.not_to raise_error
|
245
|
+
expect(described_class.uname.max_number_of_processes).to be_a(Integer)
|
292
246
|
end
|
293
247
|
|
294
|
-
example
|
295
|
-
expect{ described_class.uname.max_process_memory_size}.not_to raise_error
|
296
|
-
expect(described_class.uname.max_process_memory_size).to
|
248
|
+
example 'max_process_memory_size' do
|
249
|
+
expect{ described_class.uname.max_process_memory_size }.not_to raise_error
|
250
|
+
expect(described_class.uname.max_process_memory_size).to be_a(Integer)
|
297
251
|
end
|
298
252
|
|
299
|
-
example
|
253
|
+
example 'name' do
|
300
254
|
expect{ described_class.uname.name }.not_to raise_error
|
301
|
-
expect(described_class.uname.name).to
|
255
|
+
expect(described_class.uname.name).to be_a(String)
|
302
256
|
end
|
303
257
|
|
304
|
-
example
|
258
|
+
example 'number_of_licensed_users' do
|
305
259
|
expect{ described_class.uname.number_of_licensed_users }.not_to raise_error
|
306
|
-
expect(described_class.uname.number_of_licensed_users).to
|
260
|
+
expect(described_class.uname.number_of_licensed_users).to be_a(Integer).or be_nil
|
307
261
|
end
|
308
262
|
|
309
|
-
example
|
263
|
+
example 'number_of_processes' do
|
310
264
|
expect{ described_class.uname.number_of_processes }.not_to raise_error
|
311
|
-
expect(described_class.uname.number_of_processes).to
|
265
|
+
expect(described_class.uname.number_of_processes).to be_a(Integer)
|
312
266
|
end
|
313
267
|
|
314
|
-
example
|
268
|
+
example 'number_of_users' do
|
315
269
|
expect{ described_class.uname.number_of_users }.not_to raise_error
|
316
|
-
expect(described_class.uname.number_of_users).to
|
270
|
+
expect(described_class.uname.number_of_users).to be_a(Integer)
|
317
271
|
end
|
318
272
|
|
319
|
-
example
|
273
|
+
example 'organization', :unless => ENV['CI'] do
|
320
274
|
expect{ described_class.uname.organization }.not_to raise_error
|
321
|
-
expect(described_class.uname.organization).to
|
275
|
+
expect(described_class.uname.organization).to be_a(String)
|
322
276
|
end
|
323
277
|
|
324
|
-
example
|
278
|
+
example 'os_language' do
|
325
279
|
expect{ described_class.uname.os_language }.not_to raise_error
|
326
|
-
expect(described_class.uname.os_language).to
|
280
|
+
expect(described_class.uname.os_language).to be_a(Integer)
|
327
281
|
end
|
328
282
|
|
329
|
-
example
|
283
|
+
example 'os_product_suite' do
|
330
284
|
expect{ described_class.uname.os_product_suite }.not_to raise_error
|
331
|
-
expect(described_class.uname.os_product_suite).to
|
285
|
+
expect(described_class.uname.os_product_suite).to be_a(Integer)
|
332
286
|
end
|
333
287
|
|
334
|
-
example
|
288
|
+
example 'os_type' do
|
335
289
|
expect{ described_class.uname.os_type }.not_to raise_error
|
336
|
-
expect(described_class.uname.os_type).to
|
290
|
+
expect(described_class.uname.os_type).to be_a(Integer)
|
337
291
|
end
|
338
292
|
|
339
|
-
example
|
340
|
-
expect{ described_class.uname.other_type_description}.not_to raise_error
|
341
|
-
expect(described_class.uname.other_type_description).to
|
293
|
+
example 'other_type_description' do
|
294
|
+
expect{ described_class.uname.other_type_description }.not_to raise_error
|
295
|
+
expect(described_class.uname.other_type_description).to be_a(String).or be_nil
|
342
296
|
end
|
343
297
|
|
344
|
-
example
|
298
|
+
example 'plus_product_id' do
|
345
299
|
expect{ described_class.uname.plus_product_id }.not_to raise_error
|
346
|
-
expect(described_class.uname.plus_product_id).to
|
300
|
+
expect(described_class.uname.plus_product_id).to be_a(Integer).or be_nil
|
347
301
|
end
|
348
302
|
|
349
|
-
example
|
303
|
+
example 'plus_version_number' do
|
350
304
|
expect{ described_class.uname.plus_version_number }.not_to raise_error
|
351
|
-
expect(described_class.uname.plus_version_number).to
|
305
|
+
expect(described_class.uname.plus_version_number).to be_a(Integer).or be_nil
|
352
306
|
end
|
353
307
|
|
354
|
-
example
|
308
|
+
example 'primary' do
|
355
309
|
expect{ described_class.uname.primary }.not_to raise_error
|
356
310
|
expect(described_class.uname.primary).to eql(true).or eql(false)
|
357
311
|
end
|
358
312
|
|
359
|
-
example
|
313
|
+
example 'product_type' do
|
360
314
|
expect{ described_class.uname.product_type }.not_to raise_error
|
361
|
-
expect(described_class.uname.product_type).to
|
315
|
+
expect(described_class.uname.product_type).to be_a(Integer)
|
362
316
|
end
|
363
317
|
|
364
|
-
example
|
318
|
+
example 'quantum_length' do
|
365
319
|
expect{ described_class.uname.quantum_length }.not_to raise_error
|
366
|
-
expect(described_class.uname.quantum_length).to
|
320
|
+
expect(described_class.uname.quantum_length).to be_a(Integer).or be_nil
|
367
321
|
end
|
368
322
|
|
369
|
-
example
|
323
|
+
example 'quantum_type' do
|
370
324
|
expect{ described_class.uname.quantum_type }.not_to raise_error
|
371
|
-
expect(described_class.uname.quantum_type).to
|
325
|
+
expect(described_class.uname.quantum_type).to be_a(Integer).or be_nil
|
372
326
|
end
|
373
327
|
|
374
|
-
example
|
328
|
+
example 'registered_user', :unless => ENV['CI'] do
|
375
329
|
expect{ described_class.uname.registered_user }.not_to raise_error
|
376
|
-
expect(described_class.uname.registered_user).to
|
330
|
+
expect(described_class.uname.registered_user).to be_a(String)
|
377
331
|
end
|
378
332
|
|
379
|
-
example
|
333
|
+
example 'serial_number' do
|
380
334
|
expect{ described_class.uname.serial_number }.not_to raise_error
|
381
|
-
expect(described_class.uname.serial_number).to
|
335
|
+
expect(described_class.uname.serial_number).to be_a(String)
|
382
336
|
end
|
383
337
|
|
384
|
-
example
|
338
|
+
example 'service_pack_major_version' do
|
385
339
|
expect{ described_class.uname.service_pack_major_version }.not_to raise_error
|
386
|
-
expect(described_class.uname.service_pack_major_version).to
|
340
|
+
expect(described_class.uname.service_pack_major_version).to be_a(Integer)
|
387
341
|
end
|
388
342
|
|
389
|
-
example
|
343
|
+
example 'service_pack_minor_version' do
|
390
344
|
expect{ described_class.uname.service_pack_minor_version }.not_to raise_error
|
391
|
-
expect(described_class.uname.service_pack_minor_version).to
|
345
|
+
expect(described_class.uname.service_pack_minor_version).to be_a(Integer)
|
392
346
|
end
|
393
347
|
|
394
|
-
example
|
348
|
+
example 'status' do
|
395
349
|
expect{ described_class.uname.status }.not_to raise_error
|
396
|
-
expect(described_class.uname.status).to
|
350
|
+
expect(described_class.uname.status).to be_a(String)
|
397
351
|
end
|
398
352
|
|
399
|
-
example
|
353
|
+
example 'suite_mask' do
|
400
354
|
expect{ described_class.uname.suite_mask }.not_to raise_error
|
401
|
-
expect(described_class.uname.suite_mask).to
|
355
|
+
expect(described_class.uname.suite_mask).to be_a(Integer)
|
402
356
|
end
|
403
357
|
|
404
|
-
example
|
358
|
+
example 'system_device' do
|
405
359
|
expect{ described_class.uname.system_device }.not_to raise_error
|
406
|
-
expect(described_class.uname.system_device).to
|
360
|
+
expect(described_class.uname.system_device).to be_a(String)
|
407
361
|
end
|
408
362
|
|
409
|
-
example
|
363
|
+
example 'system_directory' do
|
410
364
|
expect{ described_class.uname.system_directory }.not_to raise_error
|
411
|
-
expect(described_class.uname.system_directory).to
|
365
|
+
expect(described_class.uname.system_directory).to be_a(String)
|
412
366
|
end
|
413
367
|
|
414
|
-
example
|
368
|
+
example 'system_drive' do
|
415
369
|
expect{ described_class.uname.system_drive }.not_to raise_error
|
416
|
-
expect(described_class.uname.system_drive).to
|
417
|
-
expect(described_class.uname.system_drive).to eql(
|
370
|
+
expect(described_class.uname.system_drive).to be_a(String)
|
371
|
+
expect(described_class.uname.system_drive).to eql('C:')
|
418
372
|
end
|
419
373
|
|
420
|
-
example
|
374
|
+
example 'total_swap_space_size' do
|
421
375
|
expect{ described_class.uname.total_swap_space_size }.not_to raise_error
|
422
|
-
expect(described_class.uname.total_swap_space_size).to
|
376
|
+
expect(described_class.uname.total_swap_space_size).to be_a(Integer).or be_nil
|
423
377
|
end
|
424
378
|
|
425
|
-
example
|
379
|
+
example 'total_virtual_memory_size' do
|
426
380
|
expect{ described_class.uname.total_virtual_memory_size }.not_to raise_error
|
427
|
-
expect(described_class.uname.total_virtual_memory_size).to
|
381
|
+
expect(described_class.uname.total_virtual_memory_size).to be_a(Integer)
|
428
382
|
end
|
429
383
|
|
430
|
-
example
|
384
|
+
example 'total_visible_memory_size' do
|
431
385
|
expect{ described_class.uname.total_visible_memory_size }.not_to raise_error
|
432
|
-
expect(described_class.uname.total_visible_memory_size).to
|
386
|
+
expect(described_class.uname.total_visible_memory_size).to be_a(Integer)
|
433
387
|
end
|
434
388
|
|
435
|
-
example
|
389
|
+
example 'version' do
|
436
390
|
expect{ described_class.uname.version }.not_to raise_error
|
437
|
-
expect(described_class.uname.version).to
|
391
|
+
expect(described_class.uname.version).to be_a(String)
|
438
392
|
end
|
439
393
|
|
440
|
-
example
|
394
|
+
example 'windows_directory' do
|
441
395
|
expect{ described_class.uname.windows_directory }.not_to raise_error
|
442
|
-
expect(described_class.uname.windows_directory).to
|
396
|
+
expect(described_class.uname.windows_directory).to be_a(String)
|
443
397
|
end
|
444
398
|
end
|
445
399
|
end
|