Skip to content

Commit 165ee41

Browse files
Merge pull request #1193 from b4ldr/drop_4.5_support
(MAINT) Remove testing logic for Puppet 4.5
2 parents b4048fd + 6d0dbeb commit 165ee41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1083
-1171
lines changed

spec/type_aliases/absolute_path_spec.rb

+24-26
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,36 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Compat::Absolute_path' do
7-
describe 'valid paths handling' do
8-
['C:/', 'C:\\', 'C:\\WINDOWS\\System32', 'C:/windows/system32', 'X:/foo/bar', 'X:\\foo\\bar', '\\\\host\\windows', '//host/windows', '/', '/var/tmp', '/var/opt/../lib/puppet',
9-
'/var/opt//lib/puppet', '/var/ůťƒ8', '/var/ネット'].each do |value|
10-
describe value.inspect do
11-
it { is_expected.to allow_value(value) }
12-
end
5+
describe 'Stdlib::Compat::Absolute_path' do
6+
describe 'valid paths handling' do
7+
['C:/', 'C:\\', 'C:\\WINDOWS\\System32', 'C:/windows/system32', 'X:/foo/bar', 'X:\\foo\\bar', '\\\\host\\windows', '//host/windows', '/', '/var/tmp', '/var/opt/../lib/puppet',
8+
'/var/opt//lib/puppet', '/var/ůťƒ8', '/var/ネット'].each do |value|
9+
describe value.inspect do
10+
it { is_expected.to allow_value(value) }
1311
end
1412
end
13+
end
1514

16-
describe 'invalid path handling' do
17-
context 'with garbage inputs' do
18-
[
19-
nil,
20-
[nil],
21-
[nil, nil],
22-
{ 'foo' => 'bar' },
23-
{},
24-
'',
25-
].each do |value|
26-
describe value.inspect do
27-
it { is_expected.not_to allow_value(value) }
28-
end
15+
describe 'invalid path handling' do
16+
context 'with garbage inputs' do
17+
[
18+
nil,
19+
[nil],
20+
[nil, nil],
21+
{ 'foo' => 'bar' },
22+
{},
23+
'',
24+
].each do |value|
25+
describe value.inspect do
26+
it { is_expected.not_to allow_value(value) }
2927
end
3028
end
29+
end
3130

32-
context 'with relative paths' do
33-
['relative1', '.', '..', './foo', '../foo', 'etc/puppetlabs/puppet', 'opt/puppet/bin', 'relative\\windows', '\\var\\ůťƒ8', '\\var\\ネット'].each do |value|
34-
describe value.inspect do
35-
it { is_expected.not_to allow_value(value) }
36-
end
31+
context 'with relative paths' do
32+
['relative1', '.', '..', './foo', '../foo', 'etc/puppetlabs/puppet', 'opt/puppet/bin', 'relative\\windows', '\\var\\ůťƒ8', '\\var\\ネット'].each do |value|
33+
describe value.inspect do
34+
it { is_expected.not_to allow_value(value) }
3735
end
3836
end
3937
end

spec/type_aliases/array_spec.rb

+21-23
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,30 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Compat::Array' do
7-
describe 'accepts arrays' do
8-
[
9-
[],
10-
['one'],
11-
[1],
12-
[{}],
13-
[[]],
14-
].each do |value|
15-
describe value.inspect do
16-
it { is_expected.to allow_value(value) }
17-
end
5+
describe 'Stdlib::Compat::Array' do
6+
describe 'accepts arrays' do
7+
[
8+
[],
9+
['one'],
10+
[1],
11+
[{}],
12+
[[]],
13+
].each do |value|
14+
describe value.inspect do
15+
it { is_expected.to allow_value(value) }
1816
end
1917
end
18+
end
2019

21-
describe 'rejects other values' do
22-
[
23-
'',
24-
'one',
25-
'1',
26-
{},
27-
].each do |value|
28-
describe value.inspect do
29-
it { is_expected.not_to allow_value(value) }
30-
end
20+
describe 'rejects other values' do
21+
[
22+
'',
23+
'one',
24+
'1',
25+
{},
26+
].each do |value|
27+
describe value.inspect do
28+
it { is_expected.not_to allow_value(value) }
3129
end
3230
end
3331
end

spec/type_aliases/base32_spec.rb

+30-32
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,39 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Base32' do
7-
describe 'valid handling' do
8-
['ASDASDDASD3453453', 'ASDASDDASD3453453=', 'ASDASDDASD3453453==', 'ASDASDDASD3453453===', 'ASDASDDASD3453453====', 'ASDASDDASD3453453=====', 'ASDASDDASD3453453======', 'asdasddasd3453453',
9-
'asdasddasd3453453=', 'asdasddasd3453453==', 'asdasddasd3453453===', 'asdasddasd3453453====', 'asdasddasd3453453=====', 'asdasddasd3453453======'].each do |value|
10-
describe value.inspect do
11-
it { is_expected.to allow_value(value) }
12-
end
5+
describe 'Stdlib::Base32' do
6+
describe 'valid handling' do
7+
['ASDASDDASD3453453', 'ASDASDDASD3453453=', 'ASDASDDASD3453453==', 'ASDASDDASD3453453===', 'ASDASDDASD3453453====', 'ASDASDDASD3453453=====', 'ASDASDDASD3453453======', 'asdasddasd3453453',
8+
'asdasddasd3453453=', 'asdasddasd3453453==', 'asdasddasd3453453===', 'asdasddasd3453453====', 'asdasddasd3453453=====', 'asdasddasd3453453======'].each do |value|
9+
describe value.inspect do
10+
it { is_expected.to allow_value(value) }
1311
end
1412
end
13+
end
1514

16-
describe 'invalid path handling' do
17-
context 'garbage inputs' do
18-
[
19-
[nil],
20-
[nil, nil],
21-
{ 'foo' => 'bar' },
22-
{},
23-
"\nASDASDDASD3453453",
24-
"\nASDASDDASD3453453\n",
25-
"ASDASDDASD3453453\n",
26-
'',
27-
'asdasd!@#$',
28-
'=asdasd9879876876+/',
29-
'asda=sd9879876876+/',
30-
'asdaxsd9879876876+/===',
31-
'asdads asdasd',
32-
'asdasddasd3453453=======',
33-
'asdaSddasd',
34-
'asdasddasd1',
35-
'asdasddasd9',
36-
].each do |value|
37-
describe value.inspect do
38-
it { is_expected.not_to allow_value(value) }
39-
end
15+
describe 'invalid path handling' do
16+
context 'garbage inputs' do
17+
[
18+
[nil],
19+
[nil, nil],
20+
{ 'foo' => 'bar' },
21+
{},
22+
"\nASDASDDASD3453453",
23+
"\nASDASDDASD3453453\n",
24+
"ASDASDDASD3453453\n",
25+
'',
26+
'asdasd!@#$',
27+
'=asdasd9879876876+/',
28+
'asda=sd9879876876+/',
29+
'asdaxsd9879876876+/===',
30+
'asdads asdasd',
31+
'asdasddasd3453453=======',
32+
'asdaSddasd',
33+
'asdasddasd1',
34+
'asdasddasd9',
35+
].each do |value|
36+
describe value.inspect do
37+
it { is_expected.not_to allow_value(value) }
4038
end
4139
end
4240
end

spec/type_aliases/base64_spec.rb

+25-27
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,34 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Base64' do
7-
describe 'valid handling' do
8-
['asdasdASDSADA342386832/746+=', 'asdasdASDSADA34238683274/6+', 'asdasdASDSADA3423868327/46+=='].each do |value|
9-
describe value.inspect do
10-
it { is_expected.to allow_value(value) }
11-
end
5+
describe 'Stdlib::Base64' do
6+
describe 'valid handling' do
7+
['asdasdASDSADA342386832/746+=', 'asdasdASDSADA34238683274/6+', 'asdasdASDSADA3423868327/46+=='].each do |value|
8+
describe value.inspect do
9+
it { is_expected.to allow_value(value) }
1210
end
1311
end
12+
end
1413

15-
describe 'invalid path handling' do
16-
context 'garbage inputs' do
17-
[
18-
[nil],
19-
[nil, nil],
20-
{ 'foo' => 'bar' },
21-
{},
22-
'',
23-
"\nasdasdASDSADA342386832/746+=",
24-
"\nasdasdASDSADA342386832/746+=\n",
25-
"asdasdASDSADA342386832/746+=\n",
26-
'asdasd!@#$',
27-
'=asdasd9879876876+/',
28-
'asda=sd9879876876+/',
29-
'asdaxsd9879876876+/===',
30-
'asdads asdasd',
31-
].each do |value|
32-
describe value.inspect do
33-
it { is_expected.not_to allow_value(value) }
34-
end
14+
describe 'invalid path handling' do
15+
context 'garbage inputs' do
16+
[
17+
[nil],
18+
[nil, nil],
19+
{ 'foo' => 'bar' },
20+
{},
21+
'',
22+
"\nasdasdASDSADA342386832/746+=",
23+
"\nasdasdASDSADA342386832/746+=\n",
24+
"asdasdASDSADA342386832/746+=\n",
25+
'asdasd!@#$',
26+
'=asdasd9879876876+/',
27+
'asda=sd9879876876+/',
28+
'asdaxsd9879876876+/===',
29+
'asdads asdasd',
30+
].each do |value|
31+
describe value.inspect do
32+
it { is_expected.not_to allow_value(value) }
3533
end
3634
end
3735
end

spec/type_aliases/bool_spec.rb

+19-21
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,28 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Compat::Bool' do
7-
describe 'accepts booleans' do
8-
[
9-
true,
10-
false,
11-
].each do |value|
12-
describe value.inspect do
13-
it { is_expected.to allow_value(value) }
14-
end
5+
describe 'Stdlib::Compat::Bool' do
6+
describe 'accepts booleans' do
7+
[
8+
true,
9+
false,
10+
].each do |value|
11+
describe value.inspect do
12+
it { is_expected.to allow_value(value) }
1513
end
1614
end
15+
end
1716

18-
describe 'rejects other values' do
19-
[
20-
[1],
21-
[{}],
22-
[true],
23-
'true',
24-
'false',
25-
].each do |value|
26-
describe value.inspect do
27-
it { is_expected.not_to allow_value(value) }
28-
end
17+
describe 'rejects other values' do
18+
[
19+
[1],
20+
[{}],
21+
[true],
22+
'true',
23+
'false',
24+
].each do |value|
25+
describe value.inspect do
26+
it { is_expected.not_to allow_value(value) }
2927
end
3028
end
3129
end

spec/type_aliases/compat__ip_address.rb

+28-30
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,36 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Compat::Ip_address' do
7-
describe 'accepts ipv4 and ipv6 addresses' do
8-
[
9-
'224.0.0.0',
10-
'255.255.255.255',
11-
'0.0.0.0',
12-
'192.88.99.0',
13-
'2001:0db8:85a3:0000:0000:8a2e:0370:7334',
14-
'fa76:8765:34ac:0823:ab76:eee9:0987:1111',
15-
].each do |value|
16-
describe value.inspect do
17-
it { is_expected.to allow_value(value) }
18-
end
5+
describe 'Stdlib::Compat::Ip_address' do
6+
describe 'accepts ipv4 and ipv6 addresses' do
7+
[
8+
'224.0.0.0',
9+
'255.255.255.255',
10+
'0.0.0.0',
11+
'192.88.99.0',
12+
'2001:0db8:85a3:0000:0000:8a2e:0370:7334',
13+
'fa76:8765:34ac:0823:ab76:eee9:0987:1111',
14+
].each do |value|
15+
describe value.inspect do
16+
it { is_expected.to allow_value(value) }
1917
end
2018
end
21-
describe 'rejects other values' do
22-
[
23-
nil,
24-
[nil],
25-
[nil, nil],
26-
{ 'foo' => 'bar' },
27-
{},
28-
'',
29-
'nope',
30-
'77',
31-
'4.4.4',
32-
'2001:0db8:85a3:000000:0000:8a2e:0370:7334',
33-
].each do |value|
34-
describe value.inspect do
35-
it { is_expected.not_to allow_value(value) }
36-
end
19+
end
20+
describe 'rejects other values' do
21+
[
22+
nil,
23+
[nil],
24+
[nil, nil],
25+
{ 'foo' => 'bar' },
26+
{},
27+
'',
28+
'nope',
29+
'77',
30+
'4.4.4',
31+
'2001:0db8:85a3:000000:0000:8a2e:0370:7334',
32+
].each do |value|
33+
describe value.inspect do
34+
it { is_expected.not_to allow_value(value) }
3735
end
3836
end
3937
end

spec/type_aliases/compat__ipv4_spec.rb

+10-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@
22

33
require 'spec_helper'
44

5-
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
6-
describe 'Stdlib::Compat::Ipv4' do
7-
describe 'accepts ipv4 addresses' do
8-
SharedData::IPV4_PATTERNS.each do |value|
9-
describe value.inspect do
10-
it { is_expected.to allow_value(value) }
11-
end
5+
describe 'Stdlib::Compat::Ipv4' do
6+
describe 'accepts ipv4 addresses' do
7+
SharedData::IPV4_PATTERNS.each do |value|
8+
describe value.inspect do
9+
it { is_expected.to allow_value(value) }
1210
end
1311
end
14-
describe 'rejects other values' do
15-
SharedData::IPV4_NEGATIVE_PATTERNS.each do |value|
16-
describe value.inspect do
17-
it { is_expected.not_to allow_value(value) }
18-
end
12+
end
13+
describe 'rejects other values' do
14+
SharedData::IPV4_NEGATIVE_PATTERNS.each do |value|
15+
describe value.inspect do
16+
it { is_expected.not_to allow_value(value) }
1917
end
2018
end
2119
end

0 commit comments

Comments
 (0)