diff options
author | Hunter Haugen <hunter@puppet.com> | 2016-10-25 10:52:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 10:52:45 -0700 |
commit | 4b15c970f5ac6bc683cfde32d782f51a63bee867 (patch) | |
tree | b1492eaf80e23f7e4d8f12894baf6e1b7b171996 /spec/aliases/ipv4_spec.rb | |
parent | 1e9128ffc890463880041690e508d7ac1d320ea5 (diff) | |
parent | ea929418c6c539fe6aa6506e520c5fe8fe68559f (diff) |
Merge pull request #680 from DavidS/modules-3980-fix-ipv4-regex
(MODULES-3980) Fix ipv4 regex validator
Diffstat (limited to 'spec/aliases/ipv4_spec.rb')
-rw-r--r-- | spec/aliases/ipv4_spec.rb | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/spec/aliases/ipv4_spec.rb b/spec/aliases/ipv4_spec.rb index e767b45..210b4b1 100644 --- a/spec/aliases/ipv4_spec.rb +++ b/spec/aliases/ipv4_spec.rb @@ -3,12 +3,7 @@ require 'spec_helper' if Puppet.version.to_f >= 4.5 describe 'test::ipv4', type: :class do describe 'accepts ipv4 addresses' do - [ - '224.0.0.0', - '255.255.255.255', - '0.0.0.0', - '192.88.99.0' - ].each do |value| + SharedData::IPV4_PATTERNS.each do |value| describe value.inspect do let(:params) {{ value: value }} it { is_expected.to compile } @@ -16,12 +11,7 @@ if Puppet.version.to_f >= 4.5 end end describe 'rejects other values' do - [ - 'nope', - '77', - '4.4.4', - '2001:0db8:85a3:0000:0000:8a2e:0370:73342001:0db8:85a3:0000:0000:8a2e:0370:7334' - ].each do |value| + 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/) } |