<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for spec/helpers.js</title>
    <meta charset="utf-8">

    <link rel="stylesheet" href="../prettify.css">

    <style>
        body, html {
            margin:0; padding: 0;
        }
        body {
            font-family: Helvetica Neue, Helvetica,Arial;
            font-size: 10pt;
        }
        div.header, div.footer {
            background: #eee;
            padding: 1em;
        }
        div.header {
            z-index: 100;
            position: fixed;
            top: 0;
            border-bottom: 1px solid #666;
            width: 100%;
        }
        div.footer {
            border-top: 1px solid #666;
        }
        div.body {
            margin-top: 10em;
        }
        div.meta {
            font-size: 90%;
            text-align: center;
        }
        h1, h2, h3 {
            font-weight: normal;
        }
        h1 {
            font-size: 12pt;
        }
        h2 {
            font-size: 10pt;
        }
        pre {
            font-family: Consolas, Menlo, Monaco, monospace;
            margin: 0;
            padding: 0;
            line-height: 14px;
            font-size: 14px;
            -moz-tab-size: 2;
            -o-tab-size:  2;
            tab-size: 2;
        }

        div.path { font-size: 110%; }
        div.path a:link, div.path a:visited { color: #000; }
        table.coverage { border-collapse: collapse; margin:0; padding: 0 }

        table.coverage td {
            margin: 0;
            padding: 0;
            color: #111;
            vertical-align: top;
        }
        table.coverage td.line-count {
            width: 50px;
            text-align: right;
            padding-right: 5px;
        }
        table.coverage td.line-coverage {
            color: #777 !important;
            text-align: right;
            border-left: 1px solid #666;
            border-right: 1px solid #666;
        }

        table.coverage td.text {
        }

        table.coverage td span.cline-any {
            display: inline-block;
            padding: 0 5px;
            width: 40px;
        }
        table.coverage td span.cline-neutral {
            background: #eee;
        }
        table.coverage td span.cline-yes {
            background: #b5d592;
            color: #999;
        }
        table.coverage td span.cline-no {
            background: #fc8c84;
        }

        .cstat-yes { color: #111; }
        .cstat-no { background: #fc8c84; color: #111; }
        .fstat-no { background: #ffc520; color: #111 !important; }
        .cbranch-no { background:  yellow !important; color: #111; }

        .cstat-skip { background: #ddd; color: #111; }
        .fstat-skip { background: #ddd; color: #111 !important; }
        .cbranch-skip { background: #ddd !important; color: #111; }

        .missing-if-branch {
            display: inline-block;
            margin-right: 10px;
            position: relative;
            padding: 0 4px;
            background: black;
            color: yellow;
        }

        .skip-if-branch {
            display: none;
            margin-right: 10px;
            position: relative;
            padding: 0 4px;
            background: #ccc;
            color: white;
        }

        .missing-if-branch .typ, .skip-if-branch .typ {
            color: inherit !important;
        }

        .entity, .metric { font-weight: bold; }
        .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
        .metric small { font-size: 80%; font-weight: normal; color: #666; }

        div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
        div.coverage-summary td, div.coverage-summary table  th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
        div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
        div.coverage-summary th.file { border-right: none !important; }
        div.coverage-summary th.pic { border-left: none !important; text-align: right; }
        div.coverage-summary th.pct { border-right: none !important; }
        div.coverage-summary th.abs { border-left: none !important; text-align: right; }
        div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
        div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
        div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap;  }
        div.coverage-summary td.pic { min-width: 120px !important;  }
        div.coverage-summary a:link { text-decoration: none; color: #000; }
        div.coverage-summary a:visited { text-decoration: none; color: #333; }
        div.coverage-summary a:hover { text-decoration: underline; }
        div.coverage-summary tfoot td { border-top: 1px solid #666; }

        div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator {
            height: 10px;
            width: 7px;
            display: inline-block;
            margin-left: 0.5em;
        }
        div.coverage-summary .yui3-datatable-sort-indicator {
            background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent;
        }
        div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator {
            background-position: 0 -20px;
        }
        div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator {
            background-position: 0 -10px;
        }

        .high { background: #b5d592 !important; }
        .medium { background: #ffe87c !important; }
        .low { background: #fc8c84 !important; }

        span.cover-fill, span.cover-empty {
            display:inline-block;
            border:1px solid #444;
            background: white;
            height: 12px;
        }
        span.cover-fill {
            background: #ccc;
            border-right: 1px solid #444;
        }
        span.cover-empty {
            background: white;
            border-left: none;
        }
        span.cover-full {
            border-right: none !important;
        }
        pre.prettyprint {
            border: none !important;
            padding: 0 !important;
            margin: 0 !important;
        }
        .com { color: #999 !important; }
        .ignore-none { color: #999; font-weight: normal; }

    </style>
</head>
<body>
<div class="header low">
    <h1>Code coverage report for <span class="entity">spec/helpers.js</span></h1>
    <h2>
        
        Statements: <span class="metric">19.23% <small>(70 / 364)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        
        Branches: <span class="metric">0% <small>(0 / 26)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        
        Functions: <span class="metric">7.81% <small>(10 / 128)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        
        Lines: <span class="metric">20.71% <small>(70 / 338)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
        
        Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
    </h2>
    <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">spec/</a> &#187; helpers.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/*global CompilerContext, Handlebars, shouldCompileTo, shouldCompileToWithPartials, shouldThrow, handlebarsEnv */
describe('helpers', function() {
  it("helper with complex lookup$", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string = "{{#goodbyes}}{{{link ../prefix}}}{{/goodbyes}}";</span>
<span class="cstat-no" title="statement not covered" >    var hash = {prefix: "/root", goodbyes: [{text: "Goodbye", url: "goodbye"}]};</span>
<span class="cstat-no" title="statement not covered" >    var helpers = {link: <span class="fstat-no" title="function not covered" >function(prefix) {</span></span>
<span class="cstat-no" title="statement not covered" >      return "&lt;a href='" + prefix + "/" + this.url + "'&gt;" + this.text + "&lt;/a&gt;";</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], "&lt;a href='/root/goodbye'&gt;Goodbye&lt;/a&gt;");</span>
  });
&nbsp;
  it("helper for raw block gets raw content", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{{{raw}}}} {{test}} {{{{/raw}}}}";</span>
<span class="cstat-no" title="statement not covered" >    var hash = { test: "hello" };</span>
<span class="cstat-no" title="statement not covered" >    var helpers = { raw: <span class="fstat-no" title="function not covered" >function(options) {</span></span>
<span class="cstat-no" title="statement not covered" >        return options.fn();</span>
    } };
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], " {{test}} ",</span>
                    "raw block helper gets raw content");
  });
  
  it("helper for raw block gets parameters", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{{{raw 1 2 3}}}} {{test}} {{{{/raw}}}}";</span>
<span class="cstat-no" title="statement not covered" >    var hash = { test: "hello" };</span>
<span class="cstat-no" title="statement not covered" >    var helpers = { raw: <span class="fstat-no" title="function not covered" >function(a, b, c, options) {</span></span>
<span class="cstat-no" title="statement not covered" >        return options.fn() + a + b + c;</span>
    } };
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], " {{test}} 123",</span>
                    "raw block helper gets raw content");
  });
  
  it("helper block with complex lookup expression", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string = "{{#goodbyes}}{{../name}}{{/goodbyes}}";</span>
<span class="cstat-no" title="statement not covered" >    var hash = {name: "Alan"};</span>
<span class="cstat-no" title="statement not covered" >    var helpers = {goodbyes: <span class="fstat-no" title="function not covered" >function(options) {</span></span>
<span class="cstat-no" title="statement not covered" >      var out = "";</span>
<span class="cstat-no" title="statement not covered" >      var byes = ["Goodbye", "goodbye", "GOODBYE"];</span>
<span class="cstat-no" title="statement not covered" >      for (var i = 0,j = byes.length; i &lt; j; i++) {</span>
<span class="cstat-no" title="statement not covered" >        out += byes[i] + " " + options.fn(this) + "! ";</span>
      }
<span class="cstat-no" title="statement not covered" >      return out;</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], "Goodbye Alan! goodbye Alan! GOODBYE Alan! ");</span>
  });
&nbsp;
  it("helper with complex lookup and nested template", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string = "{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}";</span>
<span class="cstat-no" title="statement not covered" >    var hash = {prefix: '/root', goodbyes: [{text: "Goodbye", url: "goodbye"}]};</span>
<span class="cstat-no" title="statement not covered" >    var helpers = {link: <span class="fstat-no" title="function not covered" >function (prefix, options) {</span></span>
<span class="cstat-no" title="statement not covered" >        return "&lt;a href='" + prefix + "/" + this.url + "'&gt;" + options.fn(this) + "&lt;/a&gt;";</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileToWithPartials(string, [hash, helpers], false, "&lt;a href='/root/goodbye'&gt;Goodbye&lt;/a&gt;");</span>
  });
&nbsp;
  it("helper with complex lookup and nested template in VM+Compiler", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string = "{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}";</span>
<span class="cstat-no" title="statement not covered" >    var hash = {prefix: '/root', goodbyes: [{text: "Goodbye", url: "goodbye"}]};</span>
<span class="cstat-no" title="statement not covered" >    var helpers = {link: <span class="fstat-no" title="function not covered" >function (prefix, options) {</span></span>
<span class="cstat-no" title="statement not covered" >        return "&lt;a href='" + prefix + "/" + this.url + "'&gt;" + options.fn(this) + "&lt;/a&gt;";</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileToWithPartials(string, [hash, helpers], true, "&lt;a href='/root/goodbye'&gt;Goodbye&lt;/a&gt;");</span>
  });
&nbsp;
  it("block helper", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!";</span>
<span class="cstat-no" title="statement not covered" >    var template = CompilerContext.compile(string);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    var result = template({world: "world"}, { helpers: {goodbyes: <span class="fstat-no" title="function not covered" >function(options) {</span> <span class="cstat-no" title="statement not covered" >return options.fn({text: "GOODBYE"}); </span>}}});</span>
<span class="cstat-no" title="statement not covered" >    equal(result, "GOODBYE! cruel world!", "Block helper executed");</span>
  });
&nbsp;
  it("block helper staying in the same context", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{#form}}&lt;p&gt;{{name}}&lt;/p&gt;{{/form}}";</span>
<span class="cstat-no" title="statement not covered" >    var template = CompilerContext.compile(string);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    var result = template({name: "Yehuda"}, {helpers: {form: <span class="fstat-no" title="function not covered" >function(options) {</span> <span class="cstat-no" title="statement not covered" >return "&lt;form&gt;" + options.fn(this) + "&lt;/form&gt;"; </span>} }});</span>
<span class="cstat-no" title="statement not covered" >    equal(result, "&lt;form&gt;&lt;p&gt;Yehuda&lt;/p&gt;&lt;/form&gt;", "Block helper executed with current context");</span>
  });
&nbsp;
  it("block helper should have context in this", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var source = "&lt;ul&gt;{{#people}}&lt;li&gt;{{#link}}{{name}}{{/link}}&lt;/li&gt;{{/people}}&lt;/ul&gt;";</span>
<span class="cstat-no" title="statement not covered" >    var link = <span class="fstat-no" title="function not covered" >function(options) {</span></span>
<span class="cstat-no" title="statement not covered" >      return '&lt;a href="/people/' + this.id + '"&gt;' + options.fn(this) + '&lt;/a&gt;';</span>
    };
<span class="cstat-no" title="statement not covered" >    var data = { "people": [</span>
      { "name": "Alan", "id": 1 },
      { "name": "Yehuda", "id": 2 }
    ]};
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(source, [data, {link: link}], "&lt;ul&gt;&lt;li&gt;&lt;a href=\"/people/1\"&gt;Alan&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=\"/people/2\"&gt;Yehuda&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;");</span>
  });
&nbsp;
  it("block helper for undefined value", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    shouldCompileTo("{{#empty}}shouldn't render{{/empty}}", {}, "");</span>
  });
&nbsp;
  it("block helper passing a new context", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{#form yehuda}}&lt;p&gt;{{name}}&lt;/p&gt;{{/form}}";</span>
<span class="cstat-no" title="statement not covered" >    var template = CompilerContext.compile(string);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    var result = template({yehuda: {name: "Yehuda"}}, { helpers: {form: <span class="fstat-no" title="function not covered" >function(context, options) {</span> <span class="cstat-no" title="statement not covered" >return "&lt;form&gt;" + options.fn(context) + "&lt;/form&gt;"; </span>}}});</span>
<span class="cstat-no" title="statement not covered" >    equal(result, "&lt;form&gt;&lt;p&gt;Yehuda&lt;/p&gt;&lt;/form&gt;", "Context variable resolved");</span>
  });
&nbsp;
  it("block helper passing a complex path context", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{#form yehuda/cat}}&lt;p&gt;{{name}}&lt;/p&gt;{{/form}}";</span>
<span class="cstat-no" title="statement not covered" >    var template = CompilerContext.compile(string);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    var result = template({yehuda: {name: "Yehuda", cat: {name: "Harold"}}}, { helpers: {form: <span class="fstat-no" title="function not covered" >function(context, options) {</span> <span class="cstat-no" title="statement not covered" >return "&lt;form&gt;" + options.fn(context) + "&lt;/form&gt;"; </span>}}});</span>
<span class="cstat-no" title="statement not covered" >    equal(result, "&lt;form&gt;&lt;p&gt;Harold&lt;/p&gt;&lt;/form&gt;", "Complex path variable resolved");</span>
  });
&nbsp;
  it("nested block helpers", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = "{{#form yehuda}}&lt;p&gt;{{name}}&lt;/p&gt;{{#link}}Hello{{/link}}{{/form}}";</span>
<span class="cstat-no" title="statement not covered" >    var template = CompilerContext.compile(string);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    var result = template({</span>
      yehuda: {name: "Yehuda" }
    }, {
      helpers: {
        link: <span class="fstat-no" title="function not covered" >function(options) {</span> <span class="cstat-no" title="statement not covered" >return "&lt;a href='" + this.name + "'&gt;" + options.fn(this) + "&lt;/a&gt;"; </span>},
        form: <span class="fstat-no" title="function not covered" >function(context, options) {</span> <span class="cstat-no" title="statement not covered" >return "&lt;form&gt;" + options.fn(context) + "&lt;/form&gt;"; </span>}
      }
    });
<span class="cstat-no" title="statement not covered" >    equal(result, "&lt;form&gt;&lt;p&gt;Yehuda&lt;/p&gt;&lt;a href='Yehuda'&gt;Hello&lt;/a&gt;&lt;/form&gt;", "Both blocks executed");</span>
  });
&nbsp;
  it("block helper inverted sections", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string = "{{#list people}}{{name}}{{^}}&lt;em&gt;Nobody's here&lt;/em&gt;{{/list}}";</span>
<span class="cstat-no" title="statement not covered" >    var list = <span class="fstat-no" title="function not covered" >function(context, options) {</span></span>
<span class="cstat-no" title="statement not covered" >      if (context.length &gt; 0) {</span>
<span class="cstat-no" title="statement not covered" >        var out = "&lt;ul&gt;";</span>
<span class="cstat-no" title="statement not covered" >        for(var i = 0,j=context.length; i &lt; j; i++) {</span>
<span class="cstat-no" title="statement not covered" >          out += "&lt;li&gt;";</span>
<span class="cstat-no" title="statement not covered" >          out += options.fn(context[i]);</span>
<span class="cstat-no" title="statement not covered" >          out += "&lt;/li&gt;";</span>
        }
<span class="cstat-no" title="statement not covered" >        out += "&lt;/ul&gt;";</span>
<span class="cstat-no" title="statement not covered" >        return out;</span>
      } else {
<span class="cstat-no" title="statement not covered" >        return "&lt;p&gt;" + options.inverse(this) + "&lt;/p&gt;";</span>
      }
    };
&nbsp;
<span class="cstat-no" title="statement not covered" >    var hash = {people: [{name: "Alan"}, {name: "Yehuda"}]};</span>
<span class="cstat-no" title="statement not covered" >    var empty = {people: []};</span>
<span class="cstat-no" title="statement not covered" >    var rootMessage = {</span>
      people: [],
      message: "Nobody's here"
    };
&nbsp;
<span class="cstat-no" title="statement not covered" >    var messageString = "{{#list people}}Hello{{^}}{{message}}{{/list}}";</span>
&nbsp;
    // the meaning here may be kind of hard to catch, but list.not is always called,
    // so we should see the output of both
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, { list: list }], "&lt;ul&gt;&lt;li&gt;Alan&lt;/li&gt;&lt;li&gt;Yehuda&lt;/li&gt;&lt;/ul&gt;", "an inverse wrapper is passed in as a new context");</span>
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [empty, { list: list }], "&lt;p&gt;&lt;em&gt;Nobody's here&lt;/em&gt;&lt;/p&gt;", "an inverse wrapper can be optionally called");</span>
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(messageString, [rootMessage, { list: list }], "&lt;p&gt;Nobody&amp;#x27;s here&lt;/p&gt;", "the context of an inverse is the parent of the block");</span>
  });
&nbsp;
  it('pathed lambas with parameters', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var hash = {</span>
      helper: <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >        return 'winning';</span>
      }
    };
<span class="cstat-no" title="statement not covered" >    hash.hash = hash;</span>
<span class="cstat-no" title="statement not covered" >    var helpers = {</span>
      './helper': <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >        return 'fail';</span>
      }
    };
<span class="cstat-no" title="statement not covered" >    shouldCompileTo('{{./helper 1}}', [hash, helpers], 'winning');</span>
<span class="cstat-no" title="statement not covered" >    shouldCompileTo('{{hash/helper 1}}', [hash, helpers], 'winning');</span>
  });
&nbsp;
  describe("helpers hash", function() {
    it("providing a helpers hash", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo("Goodbye {{cruel}} {{world}}!", [{cruel: "cruel"}, {world: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return "world"; </span>}}], "Goodbye cruel world!",</span>
                      "helpers hash is available");
&nbsp;
<span class="cstat-no" title="statement not covered" >      shouldCompileTo("Goodbye {{#iter}}{{cruel}} {{world}}{{/iter}}!", [{iter: [{cruel: "cruel"}]}, {world: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return "world"; </span>}}],</span>
                      "Goodbye cruel world!", "helpers hash is available inside other blocks");
    });
&nbsp;
    it("in cases of conflict, helpers win", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo("{{{lookup}}}", [{lookup: 'Explicit'}, {lookup: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return 'helpers'; </span>}}], "helpers",</span>
                      "helpers hash has precedence escaped expansion");
<span class="cstat-no" title="statement not covered" >      shouldCompileTo("{{lookup}}", [{lookup: 'Explicit'}, {lookup: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return 'helpers'; </span>}}], "helpers",</span>
                      "helpers hash has precedence simple expansion");
    });
&nbsp;
    it("the helpers hash is available is nested contexts", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo("{{#outer}}{{#inner}}{{helper}}{{/inner}}{{/outer}}",</span>
                    [{'outer': {'inner': {'unused':[]}}},  {'helper': <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return 'helper'; </span>}}], "helper",
                    "helpers hash is available in nested contexts.");
    });
&nbsp;
    it("the helper hash should augment the global hash", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      handlebarsEnv.registerHelper('test_helper', <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return 'found it!'; </span>});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(</span>
        "{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}", [
          {cruel: "cruel"},
          {world: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return "world!"; </span>}}
        ],
        "found it! Goodbye cruel world!!");
    });
  });
&nbsp;
  it("Multiple global helper registration", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var helpers = handlebarsEnv.helpers;</span>
<span class="cstat-no" title="statement not covered" >    handlebarsEnv.helpers = {};</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >    handlebarsEnv.registerHelper({</span>
      'if': helpers['if'],
      world: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return "world!"; </span>},
      test_helper: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return 'found it!'; </span>}
    });
&nbsp;
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(</span>
      "{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}",
      [{cruel: "cruel"}],
      "found it! Goodbye cruel world!!");
  });
&nbsp;
  it("decimal number literals work", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = 'Message: {{hello -1.2 1.2}}';</span>
<span class="cstat-no" title="statement not covered" >    var hash     = {};</span>
<span class="cstat-no" title="statement not covered" >    var helpers  = {hello: <span class="fstat-no" title="function not covered" >function(times, times2) {</span></span>
<span class="cstat-no" title="statement not covered" >      if(typeof times !== 'number') { <span class="cstat-no" title="statement not covered" >times = "NaN"; </span>}</span>
<span class="cstat-no" title="statement not covered" >      if(typeof times2 !== 'number') { <span class="cstat-no" title="statement not covered" >times2 = "NaN"; </span>}</span>
<span class="cstat-no" title="statement not covered" >      return "Hello " + times + " " + times2 + " times";</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], "Message: Hello -1.2 1.2 times", "template with a negative integer literal");</span>
  });
&nbsp;
  it("negative number literals work", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = 'Message: {{hello -12}}';</span>
<span class="cstat-no" title="statement not covered" >    var hash     = {};</span>
<span class="cstat-no" title="statement not covered" >    var helpers  = {hello: <span class="fstat-no" title="function not covered" >function(times) {</span></span>
<span class="cstat-no" title="statement not covered" >      if(typeof times !== 'number') { <span class="cstat-no" title="statement not covered" >times = "NaN"; </span>}</span>
<span class="cstat-no" title="statement not covered" >      return "Hello " + times + " times";</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], "Message: Hello -12 times", "template with a negative integer literal");</span>
  });
&nbsp;
  describe("String literal parameters", function() {
    it("simple literals work", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string   = 'Message: {{hello "world" 12 true false}}';</span>
<span class="cstat-no" title="statement not covered" >      var hash     = {};</span>
<span class="cstat-no" title="statement not covered" >      var helpers  = {hello: <span class="fstat-no" title="function not covered" >function(param, times, bool1, bool2) {</span></span>
<span class="cstat-no" title="statement not covered" >        if(typeof times !== 'number') { <span class="cstat-no" title="statement not covered" >times = "NaN"; </span>}</span>
<span class="cstat-no" title="statement not covered" >        if(typeof bool1 !== 'boolean') { <span class="cstat-no" title="statement not covered" >bool1 = "NaB"; </span>}</span>
<span class="cstat-no" title="statement not covered" >        if(typeof bool2 !== 'boolean') { <span class="cstat-no" title="statement not covered" >bool2 = "NaB"; </span>}</span>
<span class="cstat-no" title="statement not covered" >        return "Hello " + param + " " + times + " times: " + bool1 + " " + bool2;</span>
      }};
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, [hash, helpers], "Message: Hello world 12 times: true false", "template with a simple String literal");</span>
    });
&nbsp;
    it("using a quote in the middle of a parameter raises an error", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string   = 'Message: {{hello wo"rld"}}';</span>
<span class="cstat-no" title="statement not covered" >      shouldThrow(<span class="fstat-no" title="function not covered" >function() {</span></span>
<span class="cstat-no" title="statement not covered" >        CompilerContext.compile(string);</span>
      }, Error);
    });
&nbsp;
    it("escaping a String is possible", <span class="fstat-no" title="function not covered" >function(){</span>
<span class="cstat-no" title="statement not covered" >      var string   = 'Message: {{{hello "\\"world\\""}}}';</span>
<span class="cstat-no" title="statement not covered" >      var hash     = {};</span>
<span class="cstat-no" title="statement not covered" >      var helpers = {hello: <span class="fstat-no" title="function not covered" >function(param) {</span> <span class="cstat-no" title="statement not covered" >return "Hello " + param; </span>}};</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, [hash, helpers], "Message: Hello \"world\"", "template with an escaped String literal");</span>
    });
&nbsp;
    it("it works with ' marks", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string   = 'Message: {{{hello "Alan\'s world"}}}';</span>
<span class="cstat-no" title="statement not covered" >      var hash     = {};</span>
<span class="cstat-no" title="statement not covered" >      var helpers = {hello: <span class="fstat-no" title="function not covered" >function(param) {</span> <span class="cstat-no" title="statement not covered" >return "Hello " + param; </span>}};</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, [hash, helpers], "Message: Hello Alan's world", "template with a ' mark");</span>
    });
  });
&nbsp;
  it("negative number literals work", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >    var string   = 'Message: {{hello -12}}';</span>
<span class="cstat-no" title="statement not covered" >    var hash     = {};</span>
<span class="cstat-no" title="statement not covered" >    var helpers  = {hello: <span class="fstat-no" title="function not covered" >function(times) {</span></span>
<span class="cstat-no" title="statement not covered" >      if(typeof times !== 'number') { <span class="cstat-no" title="statement not covered" >times = "NaN"; </span>}</span>
<span class="cstat-no" title="statement not covered" >      return "Hello " + times + " times";</span>
    }};
<span class="cstat-no" title="statement not covered" >    shouldCompileTo(string, [hash, helpers], "Message: Hello -12 times", "template with a negative integer literal");</span>
  });
&nbsp;
  describe("multiple parameters", function() {
    it("simple multi-params work", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string   = 'Message: {{goodbye cruel world}}';</span>
<span class="cstat-no" title="statement not covered" >      var hash     = {cruel: "cruel", world: "world"};</span>
<span class="cstat-no" title="statement not covered" >      var helpers = {goodbye: <span class="fstat-no" title="function not covered" >function(cruel, world) {</span> <span class="cstat-no" title="statement not covered" >return "Goodbye " + cruel + " " + world; </span>}};</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, [hash, helpers], "Message: Goodbye cruel world", "regular helpers with multiple params");</span>
    });
&nbsp;
    it("block multi-params work", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string   = 'Message: {{#goodbye cruel world}}{{greeting}} {{adj}} {{noun}}{{/goodbye}}';</span>
<span class="cstat-no" title="statement not covered" >      var hash     = {cruel: "cruel", world: "world"};</span>
<span class="cstat-no" title="statement not covered" >      var helpers = {goodbye: <span class="fstat-no" title="function not covered" >function(cruel, world, options) {</span></span>
<span class="cstat-no" title="statement not covered" >        return options.fn({greeting: "Goodbye", adj: cruel, noun: world});</span>
      }};
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, [hash, helpers], "Message: Goodbye cruel world", "block helpers with multiple params");</span>
    });
  });
&nbsp;
  describe('hash', function() {
    it("helpers can take an optional hash", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile('{{goodbye cruel="CRUEL" world="WORLD" times=12}}');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          return "GOODBYE " + options.hash.cruel + " " + options.hash.world + " " + options.hash.times + " TIMES";</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var context = {};</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE CRUEL WORLD 12 TIMES", "Helper output hash");</span>
    });
&nbsp;
    it("helpers can take an optional hash with booleans", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          if (options.hash.print === true) {</span>
<span class="cstat-no" title="statement not covered" >            return "GOODBYE " + options.hash.cruel + " " + options.hash.world;</span>
          } else <span class="cstat-no" title="statement not covered" >if (options.hash.print === false) {</span>
<span class="cstat-no" title="statement not covered" >            return "NOT PRINTING";</span>
          } else {
<span class="cstat-no" title="statement not covered" >            return "THIS SHOULD NOT HAPPEN";</span>
          }
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var context = {};</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile('{{goodbye cruel="CRUEL" world="WORLD" print=true}}');</span>
<span class="cstat-no" title="statement not covered" >      var result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE CRUEL WORLD", "Helper output hash");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      template = CompilerContext.compile('{{goodbye cruel="CRUEL" world="WORLD" print=false}}');</span>
<span class="cstat-no" title="statement not covered" >      result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "NOT PRINTING", "Boolean helper parameter honored");</span>
    });
&nbsp;
    it("block helpers can take an optional hash", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile('{{#goodbye cruel="CRUEL" times=12}}world{{/goodbye}}');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          return "GOODBYE " + options.hash.cruel + " " + options.fn(this) + " " + options.hash.times + " TIMES";</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({}, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE CRUEL world 12 TIMES", "Hash parameters output");</span>
    });
&nbsp;
    it("block helpers can take an optional hash with single quoted stings", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{#goodbye cruel='CRUEL' times=12}}world{{/goodbye}}");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          return "GOODBYE " + options.hash.cruel + " " + options.fn(this) + " " + options.hash.times + " TIMES";</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({}, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE CRUEL world 12 TIMES", "Hash parameters output");</span>
    });
&nbsp;
    it("block helpers can take an optional hash with booleans", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          if (options.hash.print === true) {</span>
<span class="cstat-no" title="statement not covered" >            return "GOODBYE " + options.hash.cruel + " " + options.fn(this);</span>
          } else <span class="cstat-no" title="statement not covered" >if (options.hash.print === false) {</span>
<span class="cstat-no" title="statement not covered" >            return "NOT PRINTING";</span>
          } else {
<span class="cstat-no" title="statement not covered" >            return "THIS SHOULD NOT HAPPEN";</span>
          }
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile('{{#goodbye cruel="CRUEL" print=true}}world{{/goodbye}}');</span>
<span class="cstat-no" title="statement not covered" >      var result = template({}, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE CRUEL world", "Boolean hash parameter honored");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      template = CompilerContext.compile('{{#goodbye cruel="CRUEL" print=false}}world{{/goodbye}}');</span>
<span class="cstat-no" title="statement not covered" >      result = template({}, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "NOT PRINTING", "Boolean hash parameter honored");</span>
    });
  });
&nbsp;
  describe("helperMissing", function() {
    it("if a context is not found, helperMissing is used", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldThrow(<span class="fstat-no" title="function not covered" >function() {</span></span>
<span class="cstat-no" title="statement not covered" >          var template = CompilerContext.compile("{{hello}} {{link_to world}}");</span>
<span class="cstat-no" title="statement not covered" >          template({});</span>
      }, undefined, /Missing helper: 'link_to'/);
    });
&nbsp;
    it("if a context is not found, custom helperMissing is used", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string = "{{hello}} {{link_to world}}";</span>
<span class="cstat-no" title="statement not covered" >      var context = { hello: "Hello", world: "world" };</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        helperMissing: <span class="fstat-no" title="function not covered" >function(mesg, options) {</span>
<span class="cstat-no" title="statement not covered" >          if(options.name === "link_to") {</span>
<span class="cstat-no" title="statement not covered" >            return new Handlebars.SafeString("&lt;a&gt;" + mesg + "&lt;/a&gt;");</span>
          }
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, [context, helpers], "Hello &lt;a&gt;world&lt;/a&gt;");</span>
    });
  });
&nbsp;
  describe("knownHelpers", function() {
    it("Known helper should render helper", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{hello}}", {knownHelpers: {"hello" : true}});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({}, {helpers: {hello: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return "foo"; </span>}}});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "foo", "'foo' should === '" + result);</span>
    });
&nbsp;
    it("Unknown helper in knownHelpers only mode should be passed as undefined", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{typeof hello}}", {knownHelpers: {'typeof': true}, knownHelpersOnly: true});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({}, {helpers: {'typeof': <span class="fstat-no" title="function not covered" >function(arg) {</span> <span class="cstat-no" title="statement not covered" >return typeof arg; </span>}, hello: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return "foo"; </span>}}});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "undefined", "'undefined' should === '" + result);</span>
    });
    it("Builtin helpers available in knownHelpers only mode", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{#unless foo}}bar{{/unless}}", {knownHelpersOnly: true});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "bar", "'bar' should === '" + result);</span>
    });
    it("Field lookup works in knownHelpers only mode", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{foo}}", {knownHelpersOnly: true});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({foo: 'bar'});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "bar", "'bar' should === '" + result);</span>
    });
    it("Conditional blocks work in knownHelpers only mode", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{#foo}}bar{{/foo}}", {knownHelpersOnly: true});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({foo: 'baz'});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "bar", "'bar' should === '" + result);</span>
    });
    it("Invert blocks work in knownHelpers only mode", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{^foo}}bar{{/foo}}", {knownHelpersOnly: true});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template({foo: false});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "bar", "'bar' should === '" + result);</span>
    });
    it("Functions are bound to the context in knownHelpers only mode", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{foo}}", {knownHelpersOnly: true});</span>
<span class="cstat-no" title="statement not covered" >      var result = template({foo: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return this.bar; </span>}, bar: 'bar'});</span>
<span class="cstat-no" title="statement not covered" >      equal(result, "bar", "'bar' should === '" + result);</span>
    });
    it("Unknown helper call in knownHelpers only mode should throw", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldThrow(<span class="fstat-no" title="function not covered" >function() {</span></span>
<span class="cstat-no" title="statement not covered" >        CompilerContext.compile("{{typeof hello}}", {knownHelpersOnly: true});</span>
      }, Error);
    });
  });
&nbsp;
  describe("blockHelperMissing", function() {
    it("lambdas are resolved by blockHelperMissing, not handlebars proper", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string = "{{#truthy}}yep{{/truthy}}";</span>
<span class="cstat-no" title="statement not covered" >      var data = { truthy: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return true; </span>} };</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, data, "yep");</span>
    });
    it("lambdas resolved by blockHelperMissing are bound to the context", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var string = "{{#truthy}}yep{{/truthy}}";</span>
<span class="cstat-no" title="statement not covered" >      var boundData = { truthy: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return this.truthiness(); </span>}, truthiness: <span class="fstat-no" title="function not covered" >function() {</span> <span class="cstat-no" title="statement not covered" >return false; </span>} };</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo(string, boundData, "");</span>
    });
  });
&nbsp;
  describe('name field', function() {
    var context = {};
    var helpers = {
      blockHelperMissing: <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >        return 'missing: ' + arguments[arguments.length-1].name;</span>
      },
      helperMissing: <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >        return 'helper missing: ' + arguments[arguments.length-1].name;</span>
      },
      helper: <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >        return 'ran: ' + arguments[arguments.length-1].name;</span>
      }
    };
&nbsp;
    it('should include in ambiguous mustache calls', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{helper}}', [context, helpers], 'ran: helper');</span>
    });
    it('should include in helper mustache calls', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{helper 1}}', [context, helpers], 'ran: helper');</span>
    });
    it('should include in ambiguous block calls', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{#helper}}{{/helper}}', [context, helpers], 'ran: helper');</span>
    });
    it('should include in simple block calls', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{#./helper}}{{/./helper}}', [context, helpers], 'missing: ./helper');</span>
    });
    it('should include in helper block calls', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{#helper 1}}{{/helper}}', [context, helpers], 'ran: helper');</span>
    });
    it('should include in known helper calls', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{helper}}", {knownHelpers: {'helper': true}, knownHelpersOnly: true});</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      equal(template({}, {helpers: helpers}), 'ran: helper');</span>
    });
&nbsp;
    it('should include full id', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{#foo.helper}}{{/foo.helper}}', [{foo: {}}, helpers], 'missing: foo.helper');</span>
    });
&nbsp;
    it('should include full id if a hash is passed', <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      shouldCompileTo('{{#foo.helper bar=baz}}{{/foo.helper}}', [{foo: {}}, helpers], 'helper missing: foo.helper');</span>
    });
  });
&nbsp;
  describe('name conflicts', function() {
    it("helpers take precedence over same-named context properties", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{goodbye}} {{cruel world}}");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >          return this.goodbye.toUpperCase();</span>
        },
&nbsp;
        cruel: <span class="fstat-no" title="function not covered" >function(world) {</span>
<span class="cstat-no" title="statement not covered" >          return "cruel " + world.toUpperCase();</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var context = {</span>
        goodbye: "goodbye",
        world: "world"
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE cruel WORLD", "Helper executed");</span>
    });
&nbsp;
    it("helpers take precedence over same-named context properties$", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{#goodbye}} {{cruel world}}{{/goodbye}}");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          return this.goodbye.toUpperCase() + options.fn(this);</span>
        },
&nbsp;
        cruel: <span class="fstat-no" title="function not covered" >function(world) {</span>
<span class="cstat-no" title="statement not covered" >          return "cruel " + world.toUpperCase();</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var context = {</span>
        goodbye: "goodbye",
        world: "world"
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE cruel WORLD", "Helper executed");</span>
    });
&nbsp;
    it("Scoped names take precedence over helpers", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{this.goodbye}} {{cruel world}} {{cruel this.goodbye}}");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >          return this.goodbye.toUpperCase();</span>
        },
&nbsp;
        cruel: <span class="fstat-no" title="function not covered" >function(world) {</span>
<span class="cstat-no" title="statement not covered" >          return "cruel " + world.toUpperCase();</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var context = {</span>
        goodbye: "goodbye",
        world: "world"
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "goodbye cruel WORLD cruel GOODBYE", "Helper not executed");</span>
    });
&nbsp;
    it("Scoped names take precedence over block helpers", <span class="fstat-no" title="function not covered" >function() {</span>
<span class="cstat-no" title="statement not covered" >      var template = CompilerContext.compile("{{#goodbye}} {{cruel world}}{{/goodbye}} {{this.goodbye}}");</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >      var helpers = {</span>
        goodbye: <span class="fstat-no" title="function not covered" >function(options) {</span>
<span class="cstat-no" title="statement not covered" >          return this.goodbye.toUpperCase() + options.fn(this);</span>
        },
&nbsp;
        cruel: <span class="fstat-no" title="function not covered" >function(world) {</span>
<span class="cstat-no" title="statement not covered" >          return "cruel " + world.toUpperCase();</span>
        }
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var context = {</span>
        goodbye: "goodbye",
        world: "world"
      };
&nbsp;
<span class="cstat-no" title="statement not covered" >      var result = template(context, {helpers: helpers});</span>
<span class="cstat-no" title="statement not covered" >      equals(result, "GOODBYE cruel WORLD goodbye", "Helper executed");</span>
    });
  });
});
&nbsp;</pre></td></tr>
</table></pre>

</div>
<div class="footer">
    <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Aug 13 2014 23:50:21 GMT-0500 (CDT)</div>
</div>

<script src="../prettify.js"></script>

<script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
<script>

    YUI().use('datatable', function (Y) {

        var formatters = {
          pct: function (o) {
              o.className += o.record.get('classes')[o.column.key];
              try {
                  return o.value.toFixed(2) + '%';
              } catch (ex) { return o.value + '%'; }
          },
          html: function (o) {
              o.className += o.record.get('classes')[o.column.key];
              return o.record.get(o.column.key + '_html');
          }
        },
          defaultFormatter = function (o) {
              o.className += o.record.get('classes')[o.column.key];
              return o.value;
          };

        function getColumns(theadNode) {
            var colNodes = theadNode.all('tr th'),
                cols = [],
                col;
            colNodes.each(function (colNode) {
                col = {
                    key: colNode.getAttribute('data-col'),
                    label: colNode.get('innerHTML') || ' ',
                    sortable: !colNode.getAttribute('data-nosort'),
                    className: colNode.getAttribute('class'),
                    type: colNode.getAttribute('data-type'),
                    allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html'
                };
                col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter;
                cols.push(col);
            });
            return cols;
        }

        function getRowData(trNode, cols) {
            var tdNodes = trNode.all('td'),
                    i,
                    row = { classes: {} },
                    node,
                    name;
            for (i = 0; i < cols.length; i += 1) {
                name = cols[i].key;
                node = tdNodes.item(i);
                row[name] = node.getAttribute('data-value') || node.get('innerHTML');
                row[name + '_html'] = node.get('innerHTML');
                row.classes[name] = node.getAttribute('class');
                //Y.log('Name: ' + name + '; Value: ' + row[name]);
                if (cols[i].type === 'number') { row[name] = row[name] * 1; }
            }
            //Y.log(row);
            return row;
        }

        function getData(tbodyNode, cols) {
            var data = [];
            tbodyNode.all('tr').each(function (trNode) {
                data.push(getRowData(trNode, cols));
            });
            return data;
        }

        function replaceTable(node) {
            if (!node) { return; }
            var cols = getColumns(node.one('thead')),
                data = getData(node.one('tbody'), cols),
                table,
                parent = node.get('parentNode');

            table = new Y.DataTable({
                columns: cols,
                data: data,
                sortBy: 'file'
            });
            parent.set('innerHTML', '');
            table.render(parent);
        }

        Y.on('domready', function () {
            replaceTable(Y.one('div.coverage-summary table'));
            if (typeof prettyPrint === 'function') {
                prettyPrint();
            }
        });
    });
</script>
</body>
</html>
