From b0b804f409b8c4148f6c7a12f7315165f60592d0 Mon Sep 17 00:00:00 2001 From: thosakwe Date: Sat, 22 Oct 2016 11:21:04 -0400 Subject: [PATCH] Getting there --- lib/src/router.dart | 2 +- test/route/with_params.dart | 2 +- test/router/use.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/router.dart b/lib/src/router.dart index 025e9d62..cc42d9c2 100644 --- a/lib/src/router.dart +++ b/lib/src/router.dart @@ -189,7 +189,7 @@ class Router extends Extensible { /// For example, if the [Router] has a middleware 'y', and the `namespace` /// is 'x', then that middleware will be available as 'x.y' in the main router. /// These namespaces can be nested. - void use(Pattern path, Router router, + void mount(Pattern path, Router router, {bool hooked: true, String namespace: null}) { // Let's copy middleware, heeding the optional middleware namespace. String middlewarePrefix = namespace != null ? "$namespace." : ""; diff --git a/test/route/with_params.dart b/test/route/with_params.dart index e983a1e0..29fc8a39 100644 --- a/test/route/with_params.dart +++ b/test/route/with_params.dart @@ -6,7 +6,7 @@ main() { final fooById = foo.child(':id((?!bar)[0-9]+)', handlers: ['bar']); final bar = fooById.child('bar'); final baz = bar.child('//////baz//////', handlers: ['hello', 'world']); - final bazById = baz.child(':bazId([A-Za-z]+)'); + final bazById = baz.child(':bazId([A-Za-z]+)?'); new Router(root: foo).dumpTree(); test('matching', () { diff --git a/test/router/use.dart b/test/router/use.dart index d7fcf628..d3dea3fe 100644 --- a/test/router/use.dart +++ b/test/router/use.dart @@ -17,7 +17,7 @@ main() { c = router.post('c', 'Hello nested'); }); - parent.use('child', child); + parent.mount('child', child); parent.dumpTree(header: tattleAll([parent, child, a])); group('no params', () {