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.
@@ -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 'rspec'
7
- require 'sys/uname'
8
- require 'rbconfig'
8
+ require 'spec_helper'
9
9
 
10
10
  RSpec.describe Sys::Uname do
11
- context "universal singleton methods" do
12
- example "version constant is set to expected value" do
13
- expect(Sys::Uname::VERSION).to eql('1.2.2')
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 "machine singleton method works as expected" do
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 be_kind_of(String)
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 "version singleton method works as expected" do
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 be_kind_of(String)
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 "nodename singleton method works as expected" do
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 be_kind_of(String)
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 "release singleton method works as expected" do
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 be_kind_of(String)
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 "sysname singleton method works as expected" do
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 be_kind_of(String)
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 "singleton methods for Solaris only", :if => RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i do
54
- example "architecture singleton method works as expected on solaris" do
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 be_kind_of(String)
77
+ expect(described_class.model).to be_a(String)
102
78
  end
103
79
  end
104
80
 
105
- context "singleton methods for HP-UX only", :if => RbConfig::CONFIG['host_os'] =~ /hpux/i do
106
- example "id_number singleton method works as expected on HP-UX" do
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 be_kind_of(String)
85
+ expect(described_class.id_number).to be_a(String)
110
86
  end
111
87
  end
112
88
 
113
- context "uname struct" do
114
- example "uname struct contains expected members based on platform" do
115
- members = %w/sysname nodename machine version release/
116
- case RbConfig::CONFIG['host_os']
117
- when /linux/i
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
- expect{ described_class.uname }.not_to raise_error
152
- expect(described_class.uname).to be_kind_of(Struct)
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 "ffi" do
158
- example "ffi and internal functions are not public" do
159
- methods = described_class.methods(false).map{ |e| e.to_s }
160
- expect(methods).not_to include('get_model')
161
- expect(methods).not_to include('get_si')
162
- expect(methods).not_to include('uname_c')
163
- expect(methods).not_to include('sysctl')
164
- expect(methods).not_to include('sysinfo')
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 "instance methods for MS Windows", :if => File::ALT_SEPARATOR do
169
- example "boot_device" do
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 be_kind_of(String)
125
+ expect(described_class.uname.boot_device).to be_a(String)
172
126
  end
173
127
 
174
- example "build_number" do
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 be_kind_of(String)
130
+ expect(described_class.uname.build_number).to be_a(String)
177
131
  end
178
132
 
179
- example "build_type" do
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 be_kind_of(String)
135
+ expect(described_class.uname.build_type).to be_a(String)
182
136
  end
183
137
 
184
- example "caption" do
138
+ example 'caption' do
185
139
  expect{ described_class.uname.caption }.not_to raise_error
186
- expect(described_class.uname.caption).to be_kind_of(String)
140
+ expect(described_class.uname.caption).to be_a(String)
187
141
  end
188
142
 
189
- example "code_set" do
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 be_kind_of(String)
145
+ expect(described_class.uname.code_set).to be_a(String)
192
146
  end
193
147
 
194
- example "country_code" do
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 be_kind_of(String)
150
+ expect(described_class.uname.country_code).to be_a(String)
197
151
  end
198
152
 
199
- example "creation_class_name" do
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 be_kind_of(String)
155
+ expect(described_class.uname.creation_class_name).to be_a(String)
202
156
  end
203
157
 
204
- example "cscreation_class_name" do
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 be_kind_of(String)
160
+ expect(described_class.uname.cscreation_class_name).to be_a(String)
207
161
  end
208
162
 
209
- example "csd_version" do
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 be_kind_of(String).or be_nil
165
+ expect(described_class.uname.csd_version).to be_a(String).or be_nil
212
166
  end
213
167
 
214
- example "cs_name" do
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 be_kind_of(String)
170
+ expect(described_class.uname.cs_name).to be_a(String)
217
171
  end
218
172
 
219
- example "current_time_zone" do
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 be_kind_of(Integer)
175
+ expect(described_class.uname.current_time_zone).to be_a(Integer)
222
176
  end
223
177
 
224
- example "debug" do
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 "description" do
183
+ example 'description' do
230
184
  expect{ described_class.uname.description }.not_to raise_error
231
- expect(described_class.uname.description).to be_kind_of(String)
185
+ expect(described_class.uname.description).to be_a(String)
232
186
  end
233
187
 
234
- example "distributed" do
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 "encryption_level" do
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 be_kind_of(Integer)
195
+ expect(described_class.uname.encryption_level).to be_a(Integer)
242
196
  end
243
197
 
244
- example "foreground_application_boost" do
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 be_kind_of(Integer)
200
+ expect(described_class.uname.foreground_application_boost).to be_a(Integer)
247
201
  end
248
202
 
249
- example "free_physical_memory" do
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 be_kind_of(Integer)
205
+ expect(described_class.uname.free_physical_memory).to be_a(Integer)
252
206
  end
253
207
 
254
- example "free_space_in_paging_files" do
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 be_kind_of(Integer)
210
+ expect(described_class.uname.free_space_in_paging_files).to be_a(Integer)
257
211
  end
258
212
 
259
- example "free_virtual_memory" do
260
- expect{ described_class.uname.free_virtual_memory}.not_to raise_error
261
- expect(described_class.uname.free_virtual_memory).to be_kind_of(Integer)
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 "install_date" do
265
- expect{ described_class.uname.install_date}.not_to raise_error
266
- expect(described_class.uname.install_date).to be_kind_of(Time)
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 "last_bootup_time" do
270
- expect{ described_class.uname.last_bootup_time}.not_to raise_error
271
- expect(described_class.uname.last_bootup_time).to be_kind_of(Time)
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 "local_date_time" do
275
- expect{ described_class.uname.local_date_time}.not_to raise_error
276
- expect(described_class.uname.local_date_time).to be_kind_of(Time)
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 "locale" do
280
- expect{ described_class.uname.locale}.not_to raise_error
281
- expect(described_class.uname.locale).to be_kind_of(String)
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 "manufacturer" do
285
- expect{ described_class.uname.manufacturer}.not_to raise_error
286
- expect(described_class.uname.manufacturer).to be_kind_of(String)
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 "max_number_of_processes" do
290
- expect{ described_class.uname.max_number_of_processes}.not_to raise_error
291
- expect(described_class.uname.max_number_of_processes).to be_kind_of(Integer)
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 "max_process_memory_size" do
295
- expect{ described_class.uname.max_process_memory_size}.not_to raise_error
296
- expect(described_class.uname.max_process_memory_size).to be_kind_of(Integer)
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 "name" do
253
+ example 'name' do
300
254
  expect{ described_class.uname.name }.not_to raise_error
301
- expect(described_class.uname.name).to be_kind_of(String)
255
+ expect(described_class.uname.name).to be_a(String)
302
256
  end
303
257
 
304
- example "number_of_licensed_users" do
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 be_kind_of(Integer).or be_nil
260
+ expect(described_class.uname.number_of_licensed_users).to be_a(Integer).or be_nil
307
261
  end
308
262
 
309
- example "number_of_processes" do
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 be_kind_of(Integer)
265
+ expect(described_class.uname.number_of_processes).to be_a(Integer)
312
266
  end
313
267
 
314
- example "number_of_users" do
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 be_kind_of(Integer)
270
+ expect(described_class.uname.number_of_users).to be_a(Integer)
317
271
  end
318
272
 
319
- example "organization" do
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 be_kind_of(String)
275
+ expect(described_class.uname.organization).to be_a(String)
322
276
  end
323
277
 
324
- example "os_language" do
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 be_kind_of(Integer)
280
+ expect(described_class.uname.os_language).to be_a(Integer)
327
281
  end
328
282
 
329
- example "os_product_suite" do
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 be_kind_of(Integer)
285
+ expect(described_class.uname.os_product_suite).to be_a(Integer)
332
286
  end
333
287
 
334
- example "os_type" do
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 be_kind_of(Integer)
290
+ expect(described_class.uname.os_type).to be_a(Integer)
337
291
  end
338
292
 
339
- example "other_type_description" do
340
- expect{ described_class.uname.other_type_description}.not_to raise_error
341
- expect(described_class.uname.other_type_description).to be_kind_of(String).or be_nil
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 "plus_product_id" do
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 be_kind_of(Integer).or be_nil
300
+ expect(described_class.uname.plus_product_id).to be_a(Integer).or be_nil
347
301
  end
348
302
 
349
- example "plus_version_number" do
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 be_kind_of(Integer).or be_nil
305
+ expect(described_class.uname.plus_version_number).to be_a(Integer).or be_nil
352
306
  end
353
307
 
354
- example "primary" do
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 "product_type" do
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 be_kind_of(Integer)
315
+ expect(described_class.uname.product_type).to be_a(Integer)
362
316
  end
363
317
 
364
- example "quantum_length" do
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 be_kind_of(Integer).or be_nil
320
+ expect(described_class.uname.quantum_length).to be_a(Integer).or be_nil
367
321
  end
368
322
 
369
- example "quantum_type" do
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 be_kind_of(Integer).or be_nil
325
+ expect(described_class.uname.quantum_type).to be_a(Integer).or be_nil
372
326
  end
373
327
 
374
- example "registered_user" do
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 be_kind_of(String)
330
+ expect(described_class.uname.registered_user).to be_a(String)
377
331
  end
378
332
 
379
- example "serial_number" do
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 be_kind_of(String)
335
+ expect(described_class.uname.serial_number).to be_a(String)
382
336
  end
383
337
 
384
- example "service_pack_major_version" do
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 be_kind_of(Integer)
340
+ expect(described_class.uname.service_pack_major_version).to be_a(Integer)
387
341
  end
388
342
 
389
- example "service_pack_minor_version" do
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 be_kind_of(Integer)
345
+ expect(described_class.uname.service_pack_minor_version).to be_a(Integer)
392
346
  end
393
347
 
394
- example "status" do
348
+ example 'status' do
395
349
  expect{ described_class.uname.status }.not_to raise_error
396
- expect(described_class.uname.status).to be_kind_of(String)
350
+ expect(described_class.uname.status).to be_a(String)
397
351
  end
398
352
 
399
- example "suite_mask" do
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 be_kind_of(Integer)
355
+ expect(described_class.uname.suite_mask).to be_a(Integer)
402
356
  end
403
357
 
404
- example "system_device" do
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 be_kind_of(String)
360
+ expect(described_class.uname.system_device).to be_a(String)
407
361
  end
408
362
 
409
- example "system_directory" do
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 be_kind_of(String)
365
+ expect(described_class.uname.system_directory).to be_a(String)
412
366
  end
413
367
 
414
- example "system_drive" do
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 be_kind_of(String)
417
- expect(described_class.uname.system_drive).to eql("C:")
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 "total_swap_space_size" do
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 be_kind_of(Integer).or be_nil
376
+ expect(described_class.uname.total_swap_space_size).to be_a(Integer).or be_nil
423
377
  end
424
378
 
425
- example "total_virtual_memory_size" do
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 be_kind_of(Integer)
381
+ expect(described_class.uname.total_virtual_memory_size).to be_a(Integer)
428
382
  end
429
383
 
430
- example "total_visible_memory_size" do
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 be_kind_of(Integer)
386
+ expect(described_class.uname.total_visible_memory_size).to be_a(Integer)
433
387
  end
434
388
 
435
- example "version" do
389
+ example 'version' do
436
390
  expect{ described_class.uname.version }.not_to raise_error
437
- expect(described_class.uname.version).to be_kind_of(String)
391
+ expect(described_class.uname.version).to be_a(String)
438
392
  end
439
393
 
440
- example "windows_directory" do
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 be_kind_of(String)
396
+ expect(described_class.uname.windows_directory).to be_a(String)
443
397
  end
444
398
  end
445
399
  end