diff options
author | Mike Gerwitz <gerwitm@lovullo.com> | 2016-06-23 10:09:45 -0400 |
---|---|---|
committer | Mike Gerwitz <gerwitm@lovullo.com> | 2016-06-24 15:57:10 -0400 |
commit | 4aa88fc08c3912f378875ae06c0b3f92c8da6607 (patch) | |
tree | 06a429006f7baa91013582e8d38b42c91edd6ae5 /test | |
parent | bc45b70644c51e3b35b6332449939254dee3627f (diff) | |
download | liza-4aa88fc08c3912f378875ae06c0b3f92c8da6607.tar.gz liza-4aa88fc08c3912f378875ae06c0b3f92c8da6607.tar.bz2 liza-4aa88fc08c3912f378875ae06c0b3f92c8da6607.zip |
UnorderedList{Formatter=>} now a trait
This adds a great deal of flexibility through composition via trait
stacking.
* src/validate/formatter/UnorderedList.js: Renamed from
UnorderedListFormatter; now a trait.
* test/validate/formatter/UnorderedListTest.js: Renamed from
UnorderedListFormatterTest and adjusted to instantiate trait.
Diffstat (limited to 'test')
-rw-r--r-- | test/validate/formatter/UnorderedListTest.js (renamed from test/validate/formatter/UnorderedListFormatterTest.js) | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/test/validate/formatter/UnorderedListFormatterTest.js b/test/validate/formatter/UnorderedListTest.js index 3f3a037..6802239 100644 --- a/test/validate/formatter/UnorderedListFormatterTest.js +++ b/test/validate/formatter/UnorderedListTest.js @@ -20,14 +20,15 @@ */ -var liza = require( '../../../' ), - Sut = liza.validate.formatter.UnorderedListFormatter, - testValidate = require( './common' ).testValidate; +var liza = require( '../../../' ), + Sut = liza.validate.formatter.UnorderedList, + EchoFormatter = liza.validate.formatter.EchoFormatter, + common = require( './common' ); -describe( 'UnorderedListFormatter', function() +describe( 'UnorderedList', function() { - testValidate( Sut(), { + common.testValidate( EchoFormatter.use( Sut )(), { "": [ "", "" ], "no semi": [ "no semi", "<ul><li>no semi</li></ul>" ], @@ -138,4 +139,14 @@ describe( 'UnorderedListFormatter', function() "<ul><li>semi</li><li>colon</li></ul>" ], } ); + + + common.testMixin( + EchoFormatter, + Sut, + 'foo;', + 'bar', + 'foo; bar', + '<ul><li>foo</li><li>bar</li></ul>' + ); } ); |