File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
lib/puppet/functions/tomcat Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ # This function exists for usage of a returning the input params that is a deferred function
4+ # Will be used for deferring the values at agent level
5+ Puppet ::Functions . create_function ( :'tomcat::change' ) do
6+ dispatch :change do
7+ param 'Any' , :arg
8+ return_type 'Any'
9+ end
10+
11+ def change ( arg )
12+ arg
13+ end
14+ end
Original file line number Diff line number Diff line change 103103 augeas { "${catalina_base}-tomcat_users-${element}-${_element_name}-${name}" :
104104 lens => ' Xml.lns' ,
105105 incl => $_file,
106- changes => $changes ,
106+ changes => Deferred( ' tomcat::change ' , [ $changes ]) ,
107107 show_diff => $show_diff ,
108108 }
109109}
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'spec_helper'
4+
5+ describe 'tomcat::change' do
6+ it { is_expected . to run . with_params ( nil ) . and_return ( nil ) }
7+ it { is_expected . to run . with_params ( 2 ) . and_return ( 2 ) }
8+ it { is_expected . to run . with_params ( '' ) . and_return ( '' ) }
9+ it { is_expected . to run . with_params ( 'string' ) . and_return ( 'string' ) }
10+ it { is_expected . to run . with_params ( [ 'abc' , 2 ] ) . and_return ( [ 'abc' , 2 ] ) }
11+ end
You can’t perform that action at this time.
0 commit comments