|
7 | 7 |
|
8 | 8 | exports['pattern_assembler'] = {
|
9 | 9 | 'find_pattern_partials finds partials' : function(test){
|
10 |
| - test.expect(3); |
| 10 | + test.expect(13); |
11 | 11 |
|
12 | 12 | //setup current pattern from what we would have during execution
|
13 |
| - var currentPattern = new of.oPattern( |
| 13 | + var currentPattern = of.oPattern.create( |
14 | 14 | '/home/fakeuser/pl/source/_patterns/01-molecules/00-testing/00-test-mol.mustache', // abspath
|
15 | 15 | '01-molecules\\00-testing', // subdir
|
16 | 16 | '00-test-mol.mustache', // filename,
|
17 |
| - null // data |
| 17 | + null, // data |
| 18 | + { |
| 19 | + template: "{{> molecules-comment-header}}asdfasdf" + |
| 20 | + "{{> molecules-comment-header}}" + |
| 21 | + "{{> \n molecules-comment-header\n}}" + |
| 22 | + "{{> }}" + |
| 23 | + "{{> molecules-weird-spacing }}" + |
| 24 | + "{{> molecules-ba_d-cha*rs }}" + |
| 25 | + "{{> molecules-single-comment(description: 'A life isn\\'t like a garden. Perfect moments can be had, but not preserved, except in memory.') }}" + |
| 26 | + '{{> molecules-single-comment(description: "A life is like a \\"garden\\". Perfect moments can be had, but not preserved, except in memory.") }}' + |
| 27 | + "{{> molecules-single-comment:foo }}" + |
| 28 | + "{{> 01-molecules/06-components/03-comment-header.mustache }}" + |
| 29 | + "{{> 01-molecules/06-components/02-single-comment.mustache(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}" + |
| 30 | + "{{> molecules-single-comment:foo }}" + |
| 31 | + "{{>atoms-error(message: 'That\\'s no moon...')}}" + |
| 32 | + '{{>atoms-error(message: \'That\\\'s no moon...\')}}' |
| 33 | + } |
18 | 34 | );
|
19 |
| - currentPattern.template = "<h1>{{> molecules-comment-header}}</h1><div>{{> molecules-single-comment(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}</div>"; |
20 | 35 |
|
21 | 36 | var results = currentPattern.findPartials();
|
22 |
| - test.equals(results.length, 2); |
23 |
| - test.equals(results[0], '{{> molecules-comment-header}}'); |
24 |
| - test.equals(results[1], '{{> molecules-single-comment(description: \'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.\') }}'); |
25 |
| - |
| 37 | + console.log(results); |
| 38 | + test.equals(results.length, 12); |
| 39 | + test.equals(results[0], "{{> molecules-comment-header}}"); |
| 40 | + test.equals(results[1], "{{> molecules-comment-header}}"); |
| 41 | + test.equals(results[2], "{{> \n molecules-comment-header\n}}"); |
| 42 | + test.equals(results[3], "{{> molecules-weird-spacing }}"); |
| 43 | + test.equals(results[4], "{{> molecules-single-comment(description: 'A life isn\\'t like a garden. Perfect moments can be had, but not preserved, except in memory.') }}"); |
| 44 | + test.equals(results[5], '{{> molecules-single-comment(description: "A life is like a \\"garden\\". Perfect moments can be had, but not preserved, except in memory.") }}'); |
| 45 | + test.equals(results[6], "{{> molecules-single-comment:foo }}"); |
| 46 | + test.equals(results[7], "{{> 01-molecules/06-components/03-comment-header.mustache }}"); |
| 47 | + test.equals(results[8], "{{> 01-molecules/06-components/02-single-comment.mustache(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}"); |
| 48 | + test.equals(results[9], "{{> molecules-single-comment:foo }}"); |
| 49 | + test.equals(results[10], "{{>atoms-error(message: 'That\\'s no moon...')}}"); |
| 50 | + test.equals(results[11], "{{>atoms-error(message: 'That\\'s no moon...')}}"); |
26 | 51 | test.done();
|
27 | 52 | },
|
28 | 53 |
|
|
36 | 61 | '00-test-mol.mustache', // filename,
|
37 | 62 | null // data
|
38 | 63 | );
|
39 |
| - currentPattern.template = "<h1>{{> 01-molecules/06-components/03-comment-header.mustache }}</h1><div>{{> 01-molecules/06-components/02-single-comment(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}</div>"; |
| 64 | + currentPattern.template = "<h1>{{> 01-molecules/06-components/03-comment-header.mustache }}</h1><div>{{> 01-molecules/06-components/02-single-comment.mustache(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}</div>"; |
40 | 65 |
|
41 | 66 | var results = currentPattern.findPartials();
|
42 | 67 | test.equals(results.length, 2);
|
43 | 68 | test.equals(results[0], '{{> 01-molecules/06-components/03-comment-header.mustache }}');
|
44 |
| - test.equals(results[1], '{{> 01-molecules/06-components/02-single-comment(description: \'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.\') }}'); |
| 69 | + test.equals(results[1], '{{> 01-molecules/06-components/02-single-comment.mustache(description: \'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.\') }}'); |
45 | 70 | test.done();
|
46 | 71 | },
|
47 | 72 |
|
|
0 commit comments