Skip to content

Commit a0af839

Browse files
Merge pull request #640 from kingofzeal/dev-3.0
Fix broken unit test(s)
2 parents 5f38775 + 1b74429 commit a0af839

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed
+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
state: inreview
3+
---
14
## A Simple Include
25

36
This pattern contains an include of `test-bar`. It also has this markdown file, which does not have frontmatter.

test/files/_patterns/00-test/01-bar.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
status: complete
2+
state: complete
33
---
44
## A Simple Bit of Markup
55

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
2-
status: inprogress
2+
state: inprogress
33
---

test/lineage_hunter_tests.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ function createBasePatternLabObject() {
3434
paths: {
3535
source: {
3636
patterns: patterns_dir
37+
},
38+
public: {
39+
patterns: './test/public/_patterns'
3740
}
3841
},
3942
outputFileSuffixes: {
@@ -48,6 +51,8 @@ function createBasePatternLabObject() {
4851
pl.config.debug = false;
4952
pl.patterns = [];
5053
pl.partials = {};
54+
pl.patternGroups = {};
55+
pl.subtypePatterns = {};
5156

5257
return pl;
5358
}
@@ -266,17 +271,8 @@ tap.test('cascade_pattern_states sets the pattern state on any lineage patterns
266271
//arrange
267272
var pl = createBasePatternLabObject();
268273

269-
var atomPattern = new of.Pattern('00-test/01-bar.mustache');
270-
atomPattern.template = fs.readFileSync(pl.config.paths.source.patterns + '00-test/01-bar.mustache', 'utf8');
271-
atomPattern.extendedTemplate = atomPattern.template;
272-
atomPattern.patternState = "inreview";
273-
pattern_assembler.addPattern(atomPattern, pl);
274-
275-
var consumerPattern = new of.Pattern('00-test/00-foo.mustache');
276-
consumerPattern.template = fs.readFileSync(pl.config.paths.source.patterns + '00-test/00-foo.mustache', 'utf8');
277-
consumerPattern.extendedTemplate = consumerPattern.template;
278-
consumerPattern.patternState = "complete";
279-
pattern_assembler.addPattern(consumerPattern, pl);
274+
var atomPattern = pattern_assembler.load_pattern_iterative('00-test/01-bar.mustache', pl);
275+
var consumerPattern = pattern_assembler.load_pattern_iterative('00-test/00-foo.mustache', pl);
280276

281277
lineage_hunter.find_lineage(consumerPattern, pl);
282278

test/markdown_parser_tests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tap.test('parses pattern description block correctly when frontmatter present',
3131

3232
//assert
3333
test.equals(returnObject.markdown, '<h2>A Simple Bit of Markup</h2>\n<p>Foo cannot get simpler than bar, amiright?</p>\n');
34-
test.equals(returnObject.status, 'complete');
34+
test.equals(returnObject.state, 'complete');
3535
test.end();
3636
});
3737

@@ -45,6 +45,6 @@ tap.test('parses frontmatter only when no markdown present', function (test) {
4545

4646
//assert
4747
test.equals(returnObject.markdown, '');
48-
test.equals(returnObject.status, 'inprogress');
48+
test.equals(returnObject.state, 'inprogress');
4949
test.end();
5050
});

0 commit comments

Comments
 (0)