@@ -21,10 +21,7 @@ def read_win_file_if_exists(path)
2121 let ( :control_manifest ) { read_fixture ( '01_file_deferred.pp' ) }
2222 let ( :dsc_control_manifest_epp ) { read_fixture ( '01b_file_deferred_with_epp.pp' ) }
2323 let ( :dsc_deferred_direct ) { read_fixture ( '02_dsc_deferred_direct.pp' ) }
24- let ( :dsc_deferred_inline ) { read_fixture ( '02b_dsc_deferred_inline.pp' ) } # ← NEW
25- let ( :dsc_deferred_epp_inline ) { read_fixture ( '02c_dsc_deferred_inline_epp.pp' ) } # ← NEW
26- let ( :dsc_deferred_stringified ) { read_fixture ( '03a_dsc_deferred_stringified.pp' ) }
27- let ( :dsc_deferred_bad_unwrap ) { read_fixture ( '03b_dsc_deferred_bad_unwrap.pp' ) }
24+ let ( :dsc_deferred_inline ) { read_fixture ( '02b_dsc_deferred_inline.pp' ) }
2825
2926 it 'control (01): native file + Deferred resolves to hello-file' do
3027 result = idempotent_apply ( control_manifest )
@@ -68,35 +65,4 @@ def read_win_file_if_exists(path)
6865 raise "Unexpected 02b outcome. Exists=#{ out [ :exists ] } Content=#{ content . inspect } \n Apply:\n #{ apply . stdout } #{ apply . stderr } "
6966 end
7067 end
71-
72- # NEW 02c: inline Deferred on the DSC property (no variable intermediary)
73- it '02c: passing a Deferred inline while calling an epp' do
74- apply = apply_manifest ( dsc_deferred_epp_inline )
75- out = read_win_file_if_exists ( 'C:/Temp/from_dsc.txt' )
76- content = out [ :content ] . strip
77- if out [ :exists ] && content == 'hello-dsc-epp'
78- expect ( true ) . to be ( true )
79- elsif out [ :exists ] && content =~ %r{Deferred\s *\( |Puppet::Pops::Types::Deferred}i
80- raise "BUG: 02c wrote stringified Deferred: #{ content . inspect } \n Apply:\n #{ apply . stdout } #{ apply . stderr } "
81- else
82- raise "Unexpected 02c outcome. Exists=#{ out [ :exists ] } Content=#{ content . inspect } \n Apply:\n #{ apply . stdout } #{ apply . stderr } "
83- end
84- end
85-
86- it '03a: stringifying a Deferred writes the function form (reproduces customer report)' do
87- apply_manifest ( dsc_deferred_stringified )
88- out = read_win_file_if_exists ( 'C:/Temp/from_dsc_var_string.txt' )
89- expect ( out [ :exists ] ) . to be ( true )
90- expect ( out [ :content ] ) . to match ( %r{Deferred\s *\( |Puppet::Pops::Types::Deferred}i )
91- expect ( out [ :content ] ) . not_to match ( %r{\b hello-var\b } )
92- end
93-
94- it '03b: unwrap on a non‑Sensitive is a no‑op; also writes the function form' do
95- apply_manifest ( dsc_deferred_bad_unwrap )
96- out = read_win_file_if_exists ( 'C:/Temp/from_dsc_var_bad_unwrap.txt' )
97- out = read_win_file_if_exists ( 'C:/Temp/from_dsc_var.txt' ) unless out [ :exists ]
98- expect ( out [ :exists ] ) . to be ( true )
99- expect ( out [ :content ] ) . to match ( %r{Deferred\s *\( |Puppet::Pops::Types::Deferred}i )
100- expect ( out [ :content ] ) . not_to match ( %r{\b hello-var\b } )
101- end
10268end
0 commit comments