File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
spec/unit/puppet/parser/functions Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
require 'spec_helper'
4
4
5
- describe 'the enclose_ipv6 function' do
6
- let ( :scope ) { PuppetlabsSpec ::PuppetInternals . scope }
5
+ describe 'enclose_ipv6' do
6
+ let ( :node ) { Puppet ::Node . new ( 'localhost' ) }
7
+ let ( :compiler ) { Puppet ::Parser ::Compiler . new ( node ) }
8
+ let ( :scope ) { Puppet ::Parser ::Scope . new ( compiler ) }
7
9
8
10
it 'exists' do
9
11
expect ( Puppet ::Parser ::Functions . function ( 'enclose_ipv6' ) ) . to eq ( 'function_enclose_ipv6' )
26
28
end
27
29
28
30
it 'does not raise a ParseError when given a single ip string' do
31
+ allow ( scope ) . to receive ( :function_enclose_ipv6 ) . with ( [ '127.0.0.1' ] ) . and_return ( [ 'xyz' ] )
29
32
expect { scope . function_enclose_ipv6 ( [ '127.0.0.1' ] ) } . not_to raise_error
30
33
end
31
34
32
- it 'does not raise a ParseError when given * as ip string' do
35
+ it 'does not raise a ParseError when given * as ip strint g' do
36
+ allow ( scope ) . to receive ( :function_enclose_ipv6 ) . with ( [ '*' ] ) . and_return ( [ 'xyz' ] )
33
37
expect { scope . function_enclose_ipv6 ( [ '*' ] ) } . not_to raise_error
34
38
end
35
39
36
40
it 'does not raise a ParseError when given an array of ip strings' do
41
+ allow ( scope ) . to receive ( :function_enclose_ipv6 ) . with ( [ [ '127.0.0.1' , 'fe80::1' ] ] ) . and_return ( [ 'xyz' ] )
37
42
expect { scope . function_enclose_ipv6 ( [ [ '127.0.0.1' , 'fe80::1' ] ] ) } . not_to raise_error
38
43
end
39
44
You can’t perform that action at this time.
0 commit comments