Skip to content

Commit 08b9f34

Browse files
committed
Stub os.release.major to return a String
The os.release.major fact is defined to be a string[1], so stub it accordingly [1] https://github.com/puppetlabs/facter/blob/4.7.1/lib/schema/facter.yaml#L1156-L1157
1 parent 5f9362a commit 08b9f34

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

spec/classes/puppet_agent_osfamily_redhat_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
end
2323

2424
[
25-
['Rocky', 'el/8', 8],
26-
['AlmaLinux', 'el/8', 8],
27-
['AlmaLinux', 'el/9', 9],
28-
['Fedora', 'fedora/f36', 36],
29-
['CentOS', 'el/7', 7],
30-
['Amazon', 'el/6', 2017],
31-
['Amazon', 'el/6', 2018],
32-
['Amazon', 'amazon/2', 2],
33-
['Amazon', 'amazon/2023', 2023],
25+
['Rocky', 'el/8', '8'],
26+
['AlmaLinux', 'el/8', '8'],
27+
['AlmaLinux', 'el/9', '9'],
28+
['Fedora', 'fedora/f36', '36'],
29+
['CentOS', 'el/7', '7'],
30+
['Amazon', 'el/6', '2017'],
31+
['Amazon', 'el/6', '2018'],
32+
['Amazon', 'amazon/2', '2'],
33+
['Amazon', 'amazon/2023', '2023'],
3434
].each do |os, urlbit, osmajor|
3535
context "with #{os} and #{urlbit}" do
3636
let(:facts) do
37-
override_facts(super(), os: { name: os, release: { major: osmajor, }, })
37+
override_facts(super(), os: { name: os, release: { major: osmajor } })
3838
end
3939

4040
script = <<-SCRIPT
@@ -170,7 +170,7 @@
170170
end
171171
end
172172

173-
[['RedHat', 'el-7-x86_64', 'el-7-x86_64', 7], ['RedHat', 'el-8-x86_64', 'el-8-x86_64', 8], ['Amazon', '', 'el-6-x64', 6]].each do |os, tag, repodir, osmajor|
173+
[['RedHat', 'el-7-x86_64', 'el-7-x86_64', '7'], ['RedHat', 'el-8-x86_64', 'el-8-x86_64', '8'], ['Amazon', '', 'el-6-x64', '6']].each do |os, tag, repodir, osmajor|
174174
context "when PE on #{os}" do
175175
before(:each) do
176176
# Need to mock the PE functions

0 commit comments

Comments
 (0)