source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/aliases/ip_address.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 7 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

File size: 902 bytes
Line 
1require 'spec_helper'
2
3if Puppet.version.to_f >= 4.5
4 describe 'test::ip_address', type: :class do
5 describe 'accepts ipv4 and ipv6 addresses' do
6 [
7 '224.0.0.0',
8 '255.255.255.255',
9 '0.0.0.0',
10 '192.88.99.0',
11 '2001:0db8:85a3:0000:0000:8a2e:0370:7334',
12 'fa76:8765:34ac:0823:ab76:eee9:0987:1111'
13 ].each do |value|
14 describe value.inspect do
15 let(:params) {{ value: value }}
16 it { is_expected.to compile }
17 end
18 end
19 end
20 describe 'rejects other values' do
21 [
22 'nope',
23 '77',
24 '4.4.4',
25 '2001:0db8:85a3:000000:0000:8a2e:0370:7334'
26 ].each do |value|
27 describe value.inspect do
28 let(:params) {{ value: value }}
29 it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for/) }
30 end
31 end
32 end
33 end
34end
Note: See TracBrowser for help on using the repository browser.