@@ -41,11 +41,18 @@ describe('partials', function() {
41
41
42
42
it ( "rendering undefined partial throws an exception" , function ( ) {
43
43
shouldThrow ( function ( ) {
44
- var template = CompilerContext . compile ( "{{> whatever}}" ) ;
45
- template ( ) ;
44
+ var template = CompilerContext . compile ( "{{> whatever}}" ) ;
45
+ template ( ) ;
46
46
} , Handlebars . Exception , 'The partial whatever could not be found' ) ;
47
47
} ) ;
48
48
49
+ it ( "registering undefined partial throws an exception" , function ( ) {
50
+ shouldThrow ( function ( ) {
51
+ var undef ;
52
+ handlebarsEnv . registerPartial ( 'undefined_test' , undef ) ;
53
+ } , Handlebars . Exception , 'Attempting to register a partial as undefined' ) ;
54
+ } ) ;
55
+
49
56
it ( "rendering template partial in vm mode throws an exception" , function ( ) {
50
57
shouldThrow ( function ( ) {
51
58
var template = CompilerContext . compile ( "{{> whatever}}" ) ;
@@ -64,10 +71,10 @@ describe('partials', function() {
64
71
} ) ;
65
72
66
73
it ( "GH-14: a partial preceding a selector" , function ( ) {
67
- var string = "Dudes: {{>dude}} {{another_dude}}" ;
68
- var dude = "{{name}}" ;
69
- var hash = { name :"Jeepers" , another_dude :"Creepers" } ;
70
- shouldCompileToWithPartials ( string , [ hash , { } , { dude :dude } ] , true , "Dudes: Jeepers Creepers" , "Regular selectors can follow a partial" ) ;
74
+ var string = "Dudes: {{>dude}} {{another_dude}}" ;
75
+ var dude = "{{name}}" ;
76
+ var hash = { name :"Jeepers" , another_dude :"Creepers" } ;
77
+ shouldCompileToWithPartials ( string , [ hash , { } , { dude :dude } ] , true , "Dudes: Jeepers Creepers" , "Regular selectors can follow a partial" ) ;
71
78
} ) ;
72
79
73
80
it ( "Partials with slash paths" , function ( ) {
0 commit comments