rspec-puppet-facts 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67e267fa84f829a97dd7a211cd499b7916038eda
4
- data.tar.gz: 1cae575348cca8a0483c935f68d58d1c315b7c84
3
+ metadata.gz: 187629e1d3599c172d3b0e23135f5d92ae04a8e2
4
+ data.tar.gz: 1205b765d9578ded7591cd1822943212404f9634
5
5
  SHA512:
6
- metadata.gz: 817f91d0427e96c4d57a4d3524adc8374308c23fd805384718f803a13853c71b29383f146797654f168aa93a83483ee13efa83f89cdbbc707597978f1b6d23bf
7
- data.tar.gz: 65220d4078595dad750393f9e3ea2725b638da129d6cabd71e823d2b03c73700ffdabb1defa5e5c250551b5a6b3a69bd24f38bed35154e9ac9f0ab6f96bf418d
6
+ metadata.gz: 3d28c8fc4e11155a4c96e1f4f22816913eee8220d824305022b5bb084ec7a95a4bc4961b436b56959975beab6ee9375a01ed732302fa7c4f07ddd71e53afde9c
7
+ data.tar.gz: 7fd003eb3d0808311230355ff22dd791089d6878d7841ec8b58814c94a1ce17c09e4965c9ae4f4fbc9a275e47795739bb663f9ae74034973c93e1f9ce3d27f8d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ##2016-05-19 - Release 1.6.1
2
+ - Fix a bug where not all specified Ubuntu or OpenBSD were captured
3
+
1
4
  ##2016-05-17 - Release 1.6.0
2
5
  - Cleanup and refactor methods
3
6
  - Add YARD documentation
@@ -71,7 +71,19 @@ module RspecPuppetFacts
71
71
 
72
72
  os_facts_hash = {}
73
73
  received_facts.map do |facts|
74
- os = "#{facts[:operatingsystem].downcase}-#{facts[:operatingsystemrelease].split('.')[0]}-#{facts[:hardwaremodel]}"
74
+ # Fix facter bug
75
+ if facts[:operatingsystem] == 'Ubuntu'
76
+ operatingsystemmajrelease = facts[:operatingsystemrelease].split('.')[0..1].join('.')
77
+ elsif facts[:operatingsystem] == 'OpenBSD'
78
+ operatingsystemmajrelease = facts[:operatingsystemrelease]
79
+ else
80
+ if facts[:operatingsystemmajrelease].nil?
81
+ operatingsystemmajrelease = facts[:operatingsystemrelease].split('.')[0]
82
+ else
83
+ operatingsystemmajrelease = facts[:operatingsystemmajrelease]
84
+ end
85
+ end
86
+ os = "#{facts[:operatingsystem].downcase}-#{operatingsystemmajrelease}-#{facts[:hardwaremodel]}"
75
87
  next unless os.start_with? RspecPuppetFacts.spec_facts_os_filter if RspecPuppetFacts.spec_facts_os_filter
76
88
  facts.merge! RspecPuppetFacts.common_facts
77
89
  os_facts_hash[os] = facts
@@ -2,6 +2,6 @@ module RspecPuppetFacts
2
2
  # This module contains the current version constant
3
3
  module Version
4
4
  # The current version of this gem
5
- STRING = '1.6.0'
5
+ STRING = '1.6.1'
6
6
  end
7
7
  end
@@ -142,6 +142,40 @@ describe RspecPuppetFacts do
142
142
  end
143
143
  end
144
144
 
145
+ context 'When testing Ubuntu' do
146
+ subject {
147
+ on_supported_os(
148
+ {
149
+ :supported_os => [
150
+ {
151
+ "operatingsystem" => "Ubuntu",
152
+ "operatingsystemrelease" => [
153
+ "14.04",
154
+ "14.10",
155
+ "15.04",
156
+ "15.10",
157
+ ],
158
+ },
159
+ ],
160
+ }
161
+ )
162
+ }
163
+ it 'should return a hash' do
164
+ expect(subject.class).to eq Hash
165
+ end
166
+ it 'should have 4 elements' do
167
+ expect(subject.size).to eq 4
168
+ end
169
+ it 'should return supported OS' do
170
+ expect(subject.keys.sort).to eq [
171
+ 'ubuntu-14.04-x86_64',
172
+ 'ubuntu-14.10-x86_64',
173
+ 'ubuntu-15.04-x86_64',
174
+ 'ubuntu-15.10-x86_64',
175
+ ]
176
+ end
177
+ end
178
+
145
179
  context 'When testing FreeBSD 10' do
146
180
  subject {
147
181
  on_supported_os(
@@ -170,7 +204,7 @@ describe RspecPuppetFacts do
170
204
  end
171
205
  end
172
206
 
173
- context 'When testing OpenBSD 5.7' do
207
+ context 'When testing OpenBSD' do
174
208
  subject {
175
209
  on_supported_os(
176
210
  {
@@ -193,7 +227,7 @@ describe RspecPuppetFacts do
193
227
  end
194
228
  it 'should return supported OS' do
195
229
  expect(subject.keys.sort).to eq [
196
- 'openbsd-5-amd64',
230
+ 'openbsd-5.7-amd64',
197
231
  ]
198
232
  end
199
233
  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: 1.6.0
4
+ version: 1.6.1
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: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types