mirror of https://github.com/jo/docuri.git
Remove global state, return rules directly
This breaks backwards compatibility. This removes .routes because it's not intuitive what the result value of that must be, and users are free to .map over .route themselves. Also, .routes was never tested. Fixes #14.pull/18/head
parent
d9ab1242b4
commit
824d69fd08
@ -1,26 +0,0 @@
|
||||
var test = require('tap').test;
|
||||
var docuri = require('..');
|
||||
|
||||
test('reserved name route', function(t) {
|
||||
t.plan(1);
|
||||
|
||||
try {
|
||||
docuri.route('page', 'route');
|
||||
} catch(e) {
|
||||
t.equal(e, 'Reserved name "route" cannot be used.', 'reserved name "route" should throw error');
|
||||
}
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('reserved name routes', function(t) {
|
||||
t.plan(1);
|
||||
|
||||
try {
|
||||
docuri.route('page', 'routes');
|
||||
} catch(e) {
|
||||
t.equal(e, 'Reserved name "routes" cannot be used.', 'reserved name "routes" should throw error');
|
||||
}
|
||||
|
||||
t.end();
|
||||
});
|
Loading…
Reference in New Issue