diff --git a/test/style_modifier_hunter_tests.js b/test/style_modifier_hunter_tests.js index 4e0d7ddf3..e1a999a8b 100644 --- a/test/style_modifier_hunter_tests.js +++ b/test/style_modifier_hunter_tests.js @@ -1,86 +1,89 @@ "use strict"; +var tap = require('tap'); + var smh = require('../core/lib/style_modifier_hunter'); -exports['consume_style_modifier'] = { - 'uses the partial stylemodifer to modify the patterns extendedTemplate' : function(test){ - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.debug = false; - - var pattern = { - extendedTemplate: '
' - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier(pattern, '{{> partial:bar}}', pl); - - //assert - test.equals(pattern.extendedTemplate, ''); - test.done(); - }, - 'replaces style modifiers with spaces in the syntax' : function(test){ - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.debug = false; - - var pattern = { - extendedTemplate: '' - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier(pattern, '{{> partial:bar}}', pl); - - //assert - test.equals(pattern.extendedTemplate, ''); - test.done(); - }, - 'replaces multiple style modifiers' : function(test){ - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.debug = false; - - var pattern = { - extendedTemplate: '' - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier(pattern, '{{> partial:bar|baz|dum}}', pl); - - //assert - test.equals(pattern.extendedTemplate, ''); - test.done(); - }, - 'does not alter pattern extendedTemplate if styleModifier not found in partial' : function(test){ - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.debug = false; - - var pattern = { - extendedTemplate: '' - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier(pattern, '{{> partial}}', pl); - - //assert - test.equals(pattern.extendedTemplate, ''); - test.done(); - } -}; +tap.test('uses the partial stylemodifer to modify the patterns extendedTemplate', function(test){ + //arrange + var pl = {}; + pl.partials = {}; + pl.config = {}; + pl.config.debug = false; + + var pattern = { + extendedTemplate: '' + }; + + var style_modifier_hunter = new smh(); + + //act + style_modifier_hunter.consume_style_modifier(pattern, '{{> partial:bar}}', pl); + + //assert + test.equals(pattern.extendedTemplate, ''); + test.end(); +}); + +tap.test('replaces style modifiers with spaces in the syntax', function(test){ + //arrange + var pl = {}; + pl.partials = {}; + pl.config = {}; + pl.config.debug = false; + + var pattern = { + extendedTemplate: '' + }; + + var style_modifier_hunter = new smh(); + + //act + style_modifier_hunter.consume_style_modifier(pattern, '{{> partial:bar}}', pl); + + //assert + test.equals(pattern.extendedTemplate, ''); + test.end(); +}); + +tap.test('replaces multiple style modifiers', function(test){ + //arrange + var pl = {}; + pl.partials = {}; + pl.config = {}; + pl.config.debug = false; + + var pattern = { + extendedTemplate: '' + }; + + var style_modifier_hunter = new smh(); + + //act + style_modifier_hunter.consume_style_modifier(pattern, '{{> partial:bar|baz|dum}}', pl); + + //assert + test.equals(pattern.extendedTemplate, ''); + test.end(); +}); + +tap.test('does not alter pattern extendedTemplate if styleModifier not found in partial', function(test){ + //arrange + var pl = {}; + pl.partials = {}; + pl.config = {}; + pl.config.debug = false; + + var pattern = { + extendedTemplate: '' + }; + + var style_modifier_hunter = new smh(); + + //act + style_modifier_hunter.consume_style_modifier(pattern, '{{> partial}}', pl); + + //assert + test.equals(pattern.extendedTemplate, ''); + test.end(); +});