summaryrefslogtreecommitdiff
path: root/spec/aliases/ipv4_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/ipv4_spec.rb
parent71123634744b9fe2ec7d6a3e38e9789fd84801e3 (diff)
parentb65dd1f45d10e10e45455358aeabb29167990e2c (diff)
Merge remote-tracking branch 'origin/master' into leap_master
Diffstat (limited to 'spec/aliases/ipv4_spec.rb')
-rw-r--r--spec/aliases/ipv4_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/aliases/ipv4_spec.rb b/spec/aliases/ipv4_spec.rb
new file mode 100644
index 0000000..210b4b1
--- /dev/null
+++ b/spec/aliases/ipv4_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+ describe 'test::ipv4', type: :class do
+ describe 'accepts ipv4 addresses' do
+ SharedData::IPV4_PATTERNS.each do |value|
+ describe value.inspect do
+ let(:params) {{ value: value }}
+ it { is_expected.to compile }
+ end
+ end
+ end
+ describe 'rejects other values' do
+ SharedData::IPV4_NEGATIVE_PATTERNS.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::Compat::Ipv4/) }
+ end
+ end
+ end
+ end
+end