rspec-puppet-facts 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +1 -0
  4. data/facts/1.6/{archlinux-3-i386.facts → archlinux-i386.facts} +3 -3
  5. data/facts/1.6/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +3 -3
  6. data/facts/1.6/gentoo-i386.facts +46 -0
  7. data/facts/1.6/gentoo-x86_64.facts +46 -0
  8. data/facts/1.7/{archlinux-3-i386.facts → archlinux-i386.facts} +4 -4
  9. data/facts/1.7/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +4 -4
  10. data/facts/1.7/gentoo-i386.facts +70 -0
  11. data/facts/1.7/gentoo-x86_64.facts +70 -0
  12. data/facts/2.0/{archlinux-3-i386.facts → archlinux-i386.facts} +4 -4
  13. data/facts/2.0/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +4 -4
  14. data/facts/2.0/gentoo-i386.facts +71 -0
  15. data/facts/2.0/gentoo-x86_64.facts +71 -0
  16. data/facts/2.1/{archlinux-3-i386.facts → archlinux-i386.facts} +5 -5
  17. data/facts/2.1/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +5 -5
  18. data/facts/2.1/gentoo-i386.facts +96 -0
  19. data/facts/2.1/gentoo-x86_64.facts +96 -0
  20. data/facts/2.2/{archlinux-3-i386.facts → archlinux-i386.facts} +7 -7
  21. data/facts/2.2/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +7 -7
  22. data/facts/2.2/gentoo-i386.facts +121 -0
  23. data/facts/2.2/gentoo-x86_64.facts +121 -0
  24. data/facts/2.3/{archlinux-3-i386.facts → archlinux-i386.facts} +5 -5
  25. data/facts/2.3/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +5 -5
  26. data/facts/2.3/gentoo-i386.facts +122 -0
  27. data/facts/2.3/gentoo-x86_64.facts +122 -0
  28. data/facts/2.4/{archlinux-3-i386.facts → archlinux-i386.facts} +6 -6
  29. data/facts/2.4/{archlinux-3-x86_64.facts → archlinux-x86_64.facts} +6 -6
  30. data/facts/2.4/gentoo-i386.facts +126 -0
  31. data/facts/2.4/gentoo-x86_64.facts +126 -0
  32. data/facts/Vagrantfile +32 -32
  33. data/facts/get_facts.sh +7 -2
  34. data/lib/rspec-puppet-facts.rb +18 -2
  35. data/lib/rspec-puppet-facts/version.rb +1 -1
  36. data/spec/rspec_puppet_facts_spec.rb +13 -13
  37. metadata +30 -16
@@ -18,7 +18,12 @@ for version in 1.6.0 1.7.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0; do
18
18
  minor_version=$(echo $version | cut -c1-3)
19
19
  output_dir="/vagrant/${minor_version}"
20
20
  mkdir -p $output_dir
21
+ if [ $operatingsystem == 'archlinux' -o $operatingsystem == 'gentoo' ]; then
22
+ output_file="${output_dir}/${operatingsystem}-${hardwaremodel}.facts"
23
+ else
24
+ output_file="${output_dir}/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts"
25
+ fi
21
26
  echo $version | grep -q -E '^1\.' &&
22
- FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | bundle exec ruby -e 'require "json"; jj JSON.parse gets' | tee "${output_dir}/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts" ||
23
- FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | tee "${output_dir}/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts"
27
+ FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | bundle exec ruby -e 'require "json"; jj JSON.parse gets' | tee $output_file ||
28
+ FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | tee $output_file
24
29
  done
@@ -11,9 +11,25 @@ module RspecPuppetFacts
11
11
 
12
12
  opts[:supported_os].map do |os_sup|
13
13
  operatingsystem = os_sup['operatingsystem'].downcase
14
- os_sup['operatingsystemrelease'].map do |operatingsystemmajrelease|
14
+ if os_sup['operatingsystemrelease']
15
+ os_sup['operatingsystemrelease'].map do |operatingsystemmajrelease|
16
+ opts[:hardwaremodels].each do |hardwaremodel|
17
+ os = "#{operatingsystem}-#{operatingsystemmajrelease.split(" ")[0]}-#{hardwaremodel}"
18
+ # TODO: use SemVer here
19
+ facter_minor_version = Facter.version[0..2]
20
+ file = File.expand_path(File.join(File.dirname(__FILE__), "../facts/#{facter_minor_version}/#{os}.facts"))
21
+ # Use File.exists? instead of File.file? here so that we can stub File.file?
22
+ if ! File.exists?(file)
23
+ warn "Can't find facts for '#{os}' for facter #{facter_minor_version}, skipping..."
24
+ else
25
+ h[os] = JSON.parse(IO.read(file), :symbolize_names => true)
26
+ end
27
+ end
28
+ end
29
+ else
30
+ # Assuming this is a rolling release Operating system
15
31
  opts[:hardwaremodels].each do |hardwaremodel|
16
- os = "#{operatingsystem}-#{operatingsystemmajrelease.split(/[ \.]/)[0]}-#{hardwaremodel}"
32
+ os = "#{operatingsystem}-#{hardwaremodel}"
17
33
  # TODO: use SemVer here
18
34
  facter_minor_version = Facter.version[0..2]
19
35
  file = File.expand_path(File.join(File.dirname(__FILE__), "../facts/#{facter_minor_version}/#{os}.facts"))
@@ -1,5 +1,5 @@
1
1
  module RspecPuppetFacts
2
2
  module Version
3
- STRING = '0.7.0'
3
+ STRING = '0.8.0'
4
4
  end
5
5
  end
@@ -140,35 +140,35 @@ describe 'RspecPuppetFacts' do
140
140
  end
141
141
  end
142
142
 
143
- context 'When operatingsystemrelease has minor release' do
143
+ context 'When specifying rolling release operating system' do
144
144
  subject {
145
145
  on_supported_os(
146
146
  {
147
147
  :supported_os => [
148
148
  {
149
- "operatingsystem" => "RedHat",
149
+ "operatingsystem" => "Debian",
150
150
  "operatingsystemrelease" => [
151
- "5",
152
- "6.5",
153
- "6.6",
154
- "7.1"
155
- ]
156
- }
151
+ "8",
152
+ ],
153
+ },
154
+ {
155
+ "operatingsystem" => "Archlinux",
156
+ },
157
157
  ]
158
158
  }
159
159
  )
160
160
  }
161
+
161
162
  it 'should return a hash' do
162
163
  expect(subject.class).to eq Hash
163
164
  end
164
- it 'should have 3 elements' do
165
- expect(subject.size).to eq 3
165
+ it 'should have 2 elements' do
166
+ expect(subject.size).to eq 2
166
167
  end
167
168
  it 'should return supported OS' do
168
169
  expect(subject.keys.sort).to eq [
169
- 'redhat-5-x86_64',
170
- 'redhat-6-x86_64',
171
- 'redhat-7-x86_64',
170
+ 'archlinux-x86_64',
171
+ 'debian-8-x86_64',
172
172
  ]
173
173
  end
174
174
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-puppet-facts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickaël Canévet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-26 00:00:00.000000000 Z
11
+ date: 2015-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -123,8 +123,8 @@ files:
123
123
  - LICENSE
124
124
  - README.md
125
125
  - Rakefile
126
- - facts/1.6/archlinux-3-i386.facts
127
- - facts/1.6/archlinux-3-x86_64.facts
126
+ - facts/1.6/archlinux-i386.facts
127
+ - facts/1.6/archlinux-x86_64.facts
128
128
  - facts/1.6/centos-5-i386.facts
129
129
  - facts/1.6/centos-5-x86_64.facts
130
130
  - facts/1.6/centos-6-i386.facts
@@ -143,6 +143,8 @@ files:
143
143
  - facts/1.6/freebsd-10-x86_64.facts
144
144
  - facts/1.6/freebsd-9-i386.facts
145
145
  - facts/1.6/freebsd-9-x86_64.facts
146
+ - facts/1.6/gentoo-i386.facts
147
+ - facts/1.6/gentoo-x86_64.facts
146
148
  - facts/1.6/opensuse-12-i386.facts
147
149
  - facts/1.6/opensuse-12-x86_64.facts
148
150
  - facts/1.6/opensuse-13-i386.facts
@@ -173,8 +175,8 @@ files:
173
175
  - facts/1.6/ubuntu-12.04-x86_64.facts
174
176
  - facts/1.6/ubuntu-14.04-i386.facts
175
177
  - facts/1.6/ubuntu-14.04-x86_64.facts
176
- - facts/1.7/archlinux-3-i386.facts
177
- - facts/1.7/archlinux-3-x86_64.facts
178
+ - facts/1.7/archlinux-i386.facts
179
+ - facts/1.7/archlinux-x86_64.facts
178
180
  - facts/1.7/centos-5-i386.facts
179
181
  - facts/1.7/centos-5-x86_64.facts
180
182
  - facts/1.7/centos-6-i386.facts
@@ -193,6 +195,8 @@ files:
193
195
  - facts/1.7/freebsd-10-x86_64.facts
194
196
  - facts/1.7/freebsd-9-i386.facts
195
197
  - facts/1.7/freebsd-9-x86_64.facts
198
+ - facts/1.7/gentoo-i386.facts
199
+ - facts/1.7/gentoo-x86_64.facts
196
200
  - facts/1.7/opensuse-12-i386.facts
197
201
  - facts/1.7/opensuse-12-x86_64.facts
198
202
  - facts/1.7/opensuse-13-i386.facts
@@ -223,8 +227,8 @@ files:
223
227
  - facts/1.7/ubuntu-12.04-x86_64.facts
224
228
  - facts/1.7/ubuntu-14.04-i386.facts
225
229
  - facts/1.7/ubuntu-14.04-x86_64.facts
226
- - facts/2.0/archlinux-3-i386.facts
227
- - facts/2.0/archlinux-3-x86_64.facts
230
+ - facts/2.0/archlinux-i386.facts
231
+ - facts/2.0/archlinux-x86_64.facts
228
232
  - facts/2.0/centos-5-i386.facts
229
233
  - facts/2.0/centos-5-x86_64.facts
230
234
  - facts/2.0/centos-6-i386.facts
@@ -243,6 +247,8 @@ files:
243
247
  - facts/2.0/freebsd-10-x86_64.facts
244
248
  - facts/2.0/freebsd-9-i386.facts
245
249
  - facts/2.0/freebsd-9-x86_64.facts
250
+ - facts/2.0/gentoo-i386.facts
251
+ - facts/2.0/gentoo-x86_64.facts
246
252
  - facts/2.0/opensuse-12-i386.facts
247
253
  - facts/2.0/opensuse-12-x86_64.facts
248
254
  - facts/2.0/opensuse-13-i386.facts
@@ -273,8 +279,8 @@ files:
273
279
  - facts/2.0/ubuntu-12.04-x86_64.facts
274
280
  - facts/2.0/ubuntu-14.04-i386.facts
275
281
  - facts/2.0/ubuntu-14.04-x86_64.facts
276
- - facts/2.1/archlinux-3-i386.facts
277
- - facts/2.1/archlinux-3-x86_64.facts
282
+ - facts/2.1/archlinux-i386.facts
283
+ - facts/2.1/archlinux-x86_64.facts
278
284
  - facts/2.1/centos-5-i386.facts
279
285
  - facts/2.1/centos-5-x86_64.facts
280
286
  - facts/2.1/centos-6-i386.facts
@@ -293,6 +299,8 @@ files:
293
299
  - facts/2.1/freebsd-10-x86_64.facts
294
300
  - facts/2.1/freebsd-9-i386.facts
295
301
  - facts/2.1/freebsd-9-x86_64.facts
302
+ - facts/2.1/gentoo-i386.facts
303
+ - facts/2.1/gentoo-x86_64.facts
296
304
  - facts/2.1/opensuse-12-i386.facts
297
305
  - facts/2.1/opensuse-12-x86_64.facts
298
306
  - facts/2.1/opensuse-13-i386.facts
@@ -323,8 +331,8 @@ files:
323
331
  - facts/2.1/ubuntu-12.04-x86_64.facts
324
332
  - facts/2.1/ubuntu-14.04-i386.facts
325
333
  - facts/2.1/ubuntu-14.04-x86_64.facts
326
- - facts/2.2/archlinux-3-i386.facts
327
- - facts/2.2/archlinux-3-x86_64.facts
334
+ - facts/2.2/archlinux-i386.facts
335
+ - facts/2.2/archlinux-x86_64.facts
328
336
  - facts/2.2/centos-5-i386.facts
329
337
  - facts/2.2/centos-5-x86_64.facts
330
338
  - facts/2.2/centos-6-i386.facts
@@ -343,6 +351,8 @@ files:
343
351
  - facts/2.2/freebsd-10-x86_64.facts
344
352
  - facts/2.2/freebsd-9-i386.facts
345
353
  - facts/2.2/freebsd-9-x86_64.facts
354
+ - facts/2.2/gentoo-i386.facts
355
+ - facts/2.2/gentoo-x86_64.facts
346
356
  - facts/2.2/opensuse-12-i386.facts
347
357
  - facts/2.2/opensuse-12-x86_64.facts
348
358
  - facts/2.2/opensuse-13-i386.facts
@@ -373,8 +383,8 @@ files:
373
383
  - facts/2.2/ubuntu-12.04-x86_64.facts
374
384
  - facts/2.2/ubuntu-14.04-i386.facts
375
385
  - facts/2.2/ubuntu-14.04-x86_64.facts
376
- - facts/2.3/archlinux-3-i386.facts
377
- - facts/2.3/archlinux-3-x86_64.facts
386
+ - facts/2.3/archlinux-i386.facts
387
+ - facts/2.3/archlinux-x86_64.facts
378
388
  - facts/2.3/centos-5-i386.facts
379
389
  - facts/2.3/centos-5-x86_64.facts
380
390
  - facts/2.3/centos-6-i386.facts
@@ -393,6 +403,8 @@ files:
393
403
  - facts/2.3/freebsd-10-x86_64.facts
394
404
  - facts/2.3/freebsd-9-i386.facts
395
405
  - facts/2.3/freebsd-9-x86_64.facts
406
+ - facts/2.3/gentoo-i386.facts
407
+ - facts/2.3/gentoo-x86_64.facts
396
408
  - facts/2.3/opensuse-12-i386.facts
397
409
  - facts/2.3/opensuse-12-x86_64.facts
398
410
  - facts/2.3/opensuse-13-i386.facts
@@ -423,8 +435,8 @@ files:
423
435
  - facts/2.3/ubuntu-12.04-x86_64.facts
424
436
  - facts/2.3/ubuntu-14.04-i386.facts
425
437
  - facts/2.3/ubuntu-14.04-x86_64.facts
426
- - facts/2.4/archlinux-3-i386.facts
427
- - facts/2.4/archlinux-3-x86_64.facts
438
+ - facts/2.4/archlinux-i386.facts
439
+ - facts/2.4/archlinux-x86_64.facts
428
440
  - facts/2.4/centos-5-i386.facts
429
441
  - facts/2.4/centos-5-x86_64.facts
430
442
  - facts/2.4/centos-6-i386.facts
@@ -443,6 +455,8 @@ files:
443
455
  - facts/2.4/freebsd-10-x86_64.facts
444
456
  - facts/2.4/freebsd-9-i386.facts
445
457
  - facts/2.4/freebsd-9-x86_64.facts
458
+ - facts/2.4/gentoo-i386.facts
459
+ - facts/2.4/gentoo-x86_64.facts
446
460
  - facts/2.4/opensuse-12-i386.facts
447
461
  - facts/2.4/opensuse-12-x86_64.facts
448
462
  - facts/2.4/opensuse-13-i386.facts