Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitm@lovullo.com>2016-06-23 10:09:45 -0400
committerMike Gerwitz <gerwitm@lovullo.com>2016-06-24 15:57:10 -0400
commit4aa88fc08c3912f378875ae06c0b3f92c8da6607 (patch)
tree06a429006f7baa91013582e8d38b42c91edd6ae5 /test
parentbc45b70644c51e3b35b6332449939254dee3627f (diff)
downloadliza-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>'
+ );
} );