[Bps-public-commit] Path-Dispatcher branch, complete, updated. 6a50803ebdafabecafee609d8af38e53cf13d9a2

sartak at bestpractical.com sartak at bestpractical.com
Fri Dec 18 17:51:15 EST 2009


The branch, complete has been updated
       via  6a50803ebdafabecafee609d8af38e53cf13d9a2 (commit)
       via  db8923dfc1aaca894e737c01bb572456984a6b68 (commit)
      from  527dbedabc6bd6f60839f9794d6fc08118146b77 (commit)

Summary of changes:
 t/300-complete-simple.t                            |   38 +++++++------------
 ...00-complete-simple.t => 301-complete-complex.t} |    0
 2 files changed, 14 insertions(+), 24 deletions(-)
 copy t/{300-complete-simple.t => 301-complete-complex.t} (100%)

- Log -----------------------------------------------------------------
commit db8923dfc1aaca894e737c01bb572456984a6b68
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Dec 18 17:50:55 2009 -0500

    Okay this one is not simple!

diff --git a/t/300-complete-simple.t b/t/301-complete-complex.t
similarity index 100%
rename from t/300-complete-simple.t
rename to t/301-complete-complex.t

commit 6a50803ebdafabecafee609d8af38e53cf13d9a2
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Dec 18 17:51:08 2009 -0500

    Add an actually-simple test

diff --git a/t/300-complete-simple.t b/t/300-complete-simple.t
new file mode 100644
index 0000000..cc35ddc
--- /dev/null
+++ b/t/300-complete-simple.t
@@ -0,0 +1,28 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 10;
+
+do {
+    package MyApp::Dispatcher;
+    use Path::Dispatcher::Declarative -base;
+
+    on foo => sub { die "do not call blocks!" };
+    on bar => sub { die "do not call blocks!" };
+    on baz => sub { die "do not call blocks!" };
+};
+
+my $dispatcher = MyApp::Dispatcher->dispatcher;
+is_deeply([$dispatcher->complete('x')], [], 'no completions for "x"');
+is_deeply([$dispatcher->complete('foooo')], [], 'no completions for "foooo"');
+is_deeply([$dispatcher->complete('baq')], [], 'no completions for "baq"');
+
+is_deeply([$dispatcher->complete('f')],   ['foo'], 'one completion for "f"');
+is_deeply([$dispatcher->complete('fo')],  ['foo'], 'one completion for "fo"');
+is_deeply([$dispatcher->complete('foo')], ['foo'], 'one completion for "foo"');
+
+is_deeply([$dispatcher->complete('b')],  ['bar', 'baz'], 'two completions for "b"');
+is_deeply([$dispatcher->complete('ba')], ['bar', 'baz'], 'two completions for "ba"');
+is_deeply([$dispatcher->complete('bar')], ['bar'], 'one completion for "bar"');
+is_deeply([$dispatcher->complete('baz')], ['baz'], 'one completion for "baz"');
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list