Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / is_a_spec.rb
1 require 'spec_helper_acceptance'
2
3 if return_puppet_version =~ %r{^4}
4   describe 'is_a function' do
5     pp1 = <<-DOC
6       if 'hello world'.is_a(String) {
7         notify { 'output correct': }
8       }
9     DOC
10     it 'matches a string' do
11       apply_manifest(pp1, :catch_failures => true) do |r|
12         expect(r.stdout).to match(%r{Notice: output correct})
13       end
14     end
15
16     pp2 = <<-DOC
17       if 5.is_a(String) {
18         notify { 'output wrong': }
19       }
20     DOC
21     it 'does not match a integer as string' do
22       apply_manifest(pp2, :catch_failures => true) do |r|
23         expect(r.stdout).not_to match(%r{Notice: output wrong})
24       end
25     end
26   end
27 end