X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=t%2F10-basic.t;h=28e85222f6d6f9e9ddd62fec028fef88798e83b9;hb=442ba661f64513885fcf794469609f9da28beef1;hp=162063cbc7b09900c9bf6ce2b0576b7033a2c4ab;hpb=7c69490596e221b9d4be4d94de939429258ff7b3;p=liburi-template-perl.git diff --git a/t/10-basic.t b/t/10-basic.t index 162063c..28e8522 100644 --- a/t/10-basic.t +++ b/t/10-basic.t @@ -1,15 +1,25 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 15; use_ok( 'URI::Template' ); +# fatal - no template provided +{ + eval { URI::Template->new; }; + ok( $@ ); +} + { my $text = 'http://foo.com/{bar}/{baz}?q=%7B'; my $template = URI::Template->new( $text ); isa_ok( $template, 'URI::Template' ); - is_deeply( [ sort $template->variables ], [ qw( bar baz ) ], 'variables()' ); + is_deeply( + [ sort $template->variables ], + [ qw( bar baz ) ], + 'variables()' + ); is( "$template", $text, 'as_string()' ); { @@ -37,7 +47,7 @@ use_ok( 'URI::Template' ); is( $result, 'http://foo.com/%7Bx%7D/', 'values are uri escaped' ); } { - my $result = $template->process( ); + my $result = $template->process(); is( $result, 'http://foo.com//', 'no value sent' ); } {