@@ -222,3 +222,42 @@ tap.test('hidden handlebars patterns can be called by their nice names', functio
222
222
test . equals ( util . sanitized ( testPattern . render ( ) ) , util . sanitized ( 'Here\'s the hidden atom: [I\'m the hidden atom\n]\n' ) ) ;
223
223
test . end ( ) ;
224
224
} ) ;
225
+
226
+ tap . test ( '@partial-block template should render without throwing (@geoffp repo issue #3)' , function ( test ) {
227
+ test . plan ( 1 ) ;
228
+
229
+ var patternPath = path . join ( '00-atoms' , '00-global' , '10-at-partial-block.hbs' ) ;
230
+
231
+ // do all the normal processing of the pattern
232
+ var patternlab = new fakePatternLab ( ) ;
233
+ var assembler = new pa ( ) ;
234
+ var atPartialBlockPattern = assembler . process_pattern_iterative ( patternPath , patternlab ) ;
235
+ assembler . process_pattern_recursive ( patternPath , patternlab ) ;
236
+
237
+ var results = '{{> @partial-block }}' + eol + 'It worked!' + eol ;
238
+ test . equal ( atPartialBlockPattern . render ( ) , results ) ;
239
+ test . end ( ) ;
240
+ } )
241
+
242
+ tap . test ( 'A template calling a @partial-block template should render correctly' , function ( test ) {
243
+ test . plan ( 1 ) ;
244
+
245
+ // pattern paths
246
+ var pattern1Path = path . join ( '00-atoms' , '00-global' , '10-at-partial-block.hbs' ) ;
247
+ var pattern2Path = path . join ( '00-molecules' , '00-global' , '10-call-at-partial-block.hbs' ) ;
248
+
249
+ // set up environment
250
+ var patternlab = new fakePatternLab ( ) ; // environment
251
+ var assembler = new pa ( ) ;
252
+
253
+ // do all the normal processing of the pattern
254
+ assembler . process_pattern_iterative ( pattern1Path , patternlab ) ;
255
+ var callAtPartialBlockPattern = assembler . process_pattern_iterative ( pattern2Path , patternlab ) ;
256
+ assembler . process_pattern_recursive ( pattern1Path , patternlab ) ;
257
+ assembler . process_pattern_recursive ( pattern2Path , patternlab ) ;
258
+
259
+ // test
260
+ var results = 'Hello World!' + eol + 'It worked!' + eol ;
261
+ test . equals ( callAtPartialBlockPattern . render ( ) , results ) ;
262
+ test . end ( ) ;
263
+ } )
0 commit comments