Skip to content

Commit 0b4c46a

Browse files
committed
Use facts from rspec-puppet-facts where possible
These operating systems are listed in metadata.json and thus can use facts from rspec-puppet-facts.
1 parent 11b3563 commit 0b4c46a

File tree

1 file changed

+5
-50
lines changed

1 file changed

+5
-50
lines changed

spec/spec_helper_local.rb

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,7 @@
6464
end
6565

6666
shared_context 'Debian 8' do
67-
let :facts do
68-
{
69-
id: 'root',
70-
kernel: 'Linux',
71-
osfamily: 'Debian',
72-
operatingsystem: 'Debian',
73-
operatingsystemrelease: '8.0.0',
74-
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
75-
}
76-
end
67+
let(:facts) { on_supported_os['debian-8-x86_64'] }
7768
end
7869

7970
shared_context 'Ubuntu 14.04' do
@@ -104,42 +95,15 @@
10495
end
10596

10697
shared_context 'RedHat 6' do
107-
let :facts do
108-
{
109-
id: 'root',
110-
kernel: 'Linux',
111-
osfamily: 'RedHat',
112-
operatingsystem: 'RedHat',
113-
operatingsystemrelease: '6',
114-
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
115-
}
116-
end
98+
let(:facts) { on_supported_os['redhat-6-x86_64'] }
11799
end
118100

119101
shared_context 'RedHat 7' do
120-
let :facts do
121-
{
122-
id: 'root',
123-
kernel: 'Linux',
124-
osfamily: 'RedHat',
125-
operatingsystem: 'RedHat',
126-
operatingsystemrelease: '7',
127-
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
128-
}
129-
end
102+
let(:facts) { on_supported_os['redhat-7-x86_64'] }
130103
end
131104

132105
shared_context 'RedHat 8' do
133-
let :facts do
134-
{
135-
id: 'root',
136-
kernel: 'Linux',
137-
osfamily: 'RedHat',
138-
operatingsystem: 'RedHat',
139-
operatingsystemrelease: '8',
140-
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
141-
}
142-
end
106+
let(:facts) { on_supported_os['redhat-8-x86_64'] }
143107
end
144108

145109
shared_context 'Fedora 17' do
@@ -256,14 +220,5 @@
256220
end
257221

258222
shared_context 'SLES 12' do
259-
let :facts do
260-
{
261-
osfamily: 'Suse',
262-
operatingsystem: 'SLES',
263-
operatingsystemrelease: '12',
264-
id: 'root',
265-
kernel: 'Linux',
266-
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
267-
}
268-
end
223+
let(:facts) { on_supported_os['sles-12-x86_64'] }
269224
end

0 commit comments

Comments
 (0)