rspec-puppet-facts 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/rspec-puppet-facts.rb +13 -1
- data/lib/rspec-puppet-facts/version.rb +1 -1
- data/spec/rspec_puppet_facts_spec.rb +36 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187629e1d3599c172d3b0e23135f5d92ae04a8e2
|
4
|
+
data.tar.gz: 1205b765d9578ded7591cd1822943212404f9634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d28c8fc4e11155a4c96e1f4f22816913eee8220d824305022b5bb084ec7a95a4bc4961b436b56959975beab6ee9375a01ed732302fa7c4f07ddd71e53afde9c
|
7
|
+
data.tar.gz: 7fd003eb3d0808311230355ff22dd791089d6878d7841ec8b58814c94a1ce17c09e4965c9ae4f4fbc9a275e47795739bb663f9ae74034973c93e1f9ce3d27f8d
|
data/CHANGELOG.md
CHANGED
data/lib/rspec-puppet-facts.rb
CHANGED
@@ -71,7 +71,19 @@ module RspecPuppetFacts
|
|
71
71
|
|
72
72
|
os_facts_hash = {}
|
73
73
|
received_facts.map do |facts|
|
74
|
-
|
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
|
@@ -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
|
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.
|
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-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|