Add missing new files from commit 131e09855e06
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / type_aliases / httpurl_spec.rb
1 require 'spec_helper'
2
3 if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
4   describe 'Stdlib::HTTPUrl' do
5     describe 'valid handling' do
6       ['https://hello.com', 'https://notcreative.org', 'https://canstillaccepthttps.co.uk', 'http://anhttp.com', 'http://runningoutofideas.gov',
7        'http://', 'http://graphemica.com/❤', 'http://graphemica.com/緩', 'HTTPS://FOO.COM', 'HTTP://BAR.COM'].each do |value|
8         describe value.inspect do
9           it { is_expected.to allow_value(value) }
10         end
11       end
12     end
13
14     describe 'invalid path handling' do
15       context 'with garbage inputs' do
16         [
17           nil,
18           [nil],
19           [nil, nil],
20           { 'foo' => 'bar' },
21           {},
22           '',
23           'httds://notquiteright.org',
24           'hptts:/nah',
25           'https;//notrightbutclose.org',
26           'hts://graphemica.com/❤',
27           'https:graphemica.com/緩',
28         ].each do |value|
29           describe value.inspect do
30             it { is_expected.not_to allow_value(value) }
31           end
32         end
33       end
34     end
35   end
36 end