summaryrefslogtreecommitdiff
path: root/spec/aliases/httpsurl_spec.rb
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-01-13 12:41:58 +0100
committervarac <varacanero@zeromail.org>2017-01-13 12:41:58 +0100
commit066c08f8362d53f0f30897cb8710d11260c726ea (patch)
treea6369eecd88bb731fe413d0bbc8af73d74d1f447 /spec/aliases/httpsurl_spec.rb
parent71123634744b9fe2ec7d6a3e38e9789fd84801e3 (diff)
parentb65dd1f45d10e10e45455358aeabb29167990e2c (diff)
Merge remote-tracking branch 'origin/master' into leap_master
Diffstat (limited to 'spec/aliases/httpsurl_spec.rb')
-rw-r--r--spec/aliases/httpsurl_spec.rb40
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