diff options
author | Helen Campbell <helen@puppetlabs.com> | 2016-10-06 14:22:13 +0100 |
---|---|---|
committer | Helen Campbell <helen@puppetlabs.com> | 2016-10-07 14:18:34 +0100 |
commit | 83539371e5b1e6ff412eda48c3a725653c506ece (patch) | |
tree | df4613b9feab0048cefef62b941f62a2ae63f94b /spec/aliases/httpsurl_spec.rb | |
parent | 4aa519e998f2f4ce567bcaae5880800884a44bf6 (diff) |
Addition of several new types
Diffstat (limited to 'spec/aliases/httpsurl_spec.rb')
-rw-r--r-- | spec/aliases/httpsurl_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/aliases/httpsurl_spec.rb b/spec/aliases/httpsurl_spec.rb new file mode 100644 index 0000000..97ae006 --- /dev/null +++ b/spec/aliases/httpsurl_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +if Puppet.version.to_f >= 4.5 + describe 'test::httpsurl', type: :class do + describe 'valid handling' do + %w{ + https://hello.com + https://notcreative.org + https://notexciting.co.uk + }.each do |value| + describe value.inspect do + let(:params) {{ value: value }} + it { is_expected.to compile } + end + end + end + + describe 'invalid path handling' do + context 'garbage inputs' do + [ + nil, + [ nil ], + [ nil, nil ], + { 'foo' => 'bar' }, + { }, + '', + "httds://notquiteright.org", + "hptts:/nah", + "https;//notrightbutclose.org" + ].each do |value| + describe value.inspect do + let(:params) {{ value: value }} + it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::HTTPSUrl/) } + end + end + end + + end + end +end |