Skip to content

Commit 9145c33

Browse files
committed
foundation for the pattern_assembler tests
1 parent fe81de1 commit 9145c33

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

builder/pattern_assembler.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v0.10.0 - 2015
3-
*
1+
/*
2+
* patternlab-node - v0.10.0 - 2015
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

test/pattern_assembler_tests.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
(function () {
2+
"use strict";
3+
4+
var pa = require('../builder/pattern_assembler');
5+
6+
exports['pattern_assembler'] = {
7+
'find_pattern_partials finds partials' : function(test){
8+
9+
//setup current pattern from what we would have during execution
10+
var currentPattern = {
11+
"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>",
12+
};
13+
14+
var pattern_assembler = new pa();
15+
16+
var results = pattern_assembler.find_pattern_partials(currentPattern);
17+
test.equals(results.length, 2);
18+
test.equals(results[0], '{{> molecules-comment-header}}');
19+
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.\') }}');
20+
21+
test.done();
22+
}
23+
24+
};
25+
26+
}());

0 commit comments

Comments
 (0)