diff options
| -rw-r--r-- | t/00-load.t | 3 | ||||
| -rw-r--r-- | t/02-app.t | 20 | ||||
| -rw-r--r-- | t/index.tx | 3 |
3 files changed, 24 insertions, 2 deletions
diff --git a/t/00-load.t b/t/00-load.t index da6530d..d4ef20b 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -3,6 +3,5 @@ use warnings; use Test::More tests => 1; BEGIN { - use_ok( 'Dancer::Template::Xslate' ) || print "Bail out! -"; + use_ok( 'Dancer::Template::Xslate' ) || print "Bail out!"; } diff --git a/t/02-app.t b/t/02-app.t new file mode 100644 index 0000000..73e738c --- /dev/null +++ b/t/02-app.t @@ -0,0 +1,20 @@ +use strict; +use warnings; +use Test::More import => ["!pass"]; + +use Dancer ':syntax'; +use Dancer::Test; + +plan tests => 3; + +setting template => 'xslate'; +setting views => 't'; + +ok( + get '/' => sub { + template 'index', { loop => [1..2] }; + } +); + +route_exists [ GET => '/' ]; +response_content_like( [ GET => '/' ], qr/1<br \/>\n2/ ); diff --git a/t/index.tx b/t/index.tx new file mode 100644 index 0000000..8ecc8e1 --- /dev/null +++ b/t/index.tx @@ -0,0 +1,3 @@ +:for $loop -> $i { +<: $i :><br /> +:} |
