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