Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / has_ip_network_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'has_ip_network function', :unless => ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do
4   describe 'success' do
5     pp1 = <<-DOC
6       $a = '127.0.0.0'
7       $o = has_ip_network($a)
8       notice(inline_template('has_ip_network is <%= @o.inspect %>'))
9     DOC
10     it 'has_ip_network existing ipaddress' do
11       apply_manifest(pp1, :catch_failures => true) do |r|
12         expect(r.stdout).to match(%r{has_ip_network is true})
13       end
14     end
15
16     pp2 = <<-DOC
17       $a = '128.0.0.0'
18       $o = has_ip_network($a)
19       notice(inline_template('has_ip_network is <%= @o.inspect %>'))
20     DOC
21     it 'has_ip_network absent ipaddress' do
22       apply_manifest(pp2, :catch_failures => true) do |r|
23         expect(r.stdout).to match(%r{has_ip_network is false})
24       end
25     end
26   end
27   describe 'failure' do
28     it 'handles no arguments'
29     it 'handles non strings'
30   end
31 end