X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_uri_with.t;fp=t%2Faggregate%2Funit_core_uri_with.t;h=0000000000000000000000000000000000000000;hb=f436bc1bece2bcc2a04138068e5c22e70d9d6d35;hp=c8a3ef008d51e93d968a0d79a42d4c24890a9e4c;hpb=e28a6876ad3e11890226e5bab6df4b0725e0981e;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_uri_with.t b/t/aggregate/unit_core_uri_with.t deleted file mode 100644 index c8a3ef0..0000000 --- a/t/aggregate/unit_core_uri_with.t +++ /dev/null @@ -1,69 +0,0 @@ -use strict; -use warnings; - -use Test::More tests => 10; -use URI; - -use_ok('Catalyst::Request'); - -my $request = Catalyst::Request->new( { - uri => URI->new('http://127.0.0.1/foo/bar/baz') - } ); - -is( - $request->uri_with({}), - 'http://127.0.0.1/foo/bar/baz', - 'URI for absolute path' -); - -is( - $request->uri_with({ foo => 'bar' }), - 'http://127.0.0.1/foo/bar/baz?foo=bar', - 'URI adds param' -); - -my $request2 = Catalyst::Request->new( { - uri => URI->new('http://127.0.0.1/foo/bar/baz?bar=gorch') - } ); -is( - $request2->uri_with({}), - 'http://127.0.0.1/foo/bar/baz?bar=gorch', - 'URI retains param' -); - -is( - $request2->uri_with({ me => 'awesome' }), - 'http://127.0.0.1/foo/bar/baz?bar=gorch&me=awesome', - 'URI retains param and adds new' -); - -is( - $request2->uri_with({ bar => undef }), - 'http://127.0.0.1/foo/bar/baz', - 'URI loses param when explicitly undef' -); - -is( - $request2->uri_with({ bar => 'snort' }), - 'http://127.0.0.1/foo/bar/baz?bar=snort', - 'URI changes param' -); - -is( - $request2->uri_with({ bar => [ 'snort', 'ewok' ] }), - 'http://127.0.0.1/foo/bar/baz?bar=snort&bar=ewok', - 'overwrite mode URI appends arrayref param' -); - -is( - $request2->uri_with({ bar => 'snort' }, { mode => 'append' }), - 'http://127.0.0.1/foo/bar/baz?bar=gorch&bar=snort', - 'append mode URI appends param' -); - -is( - $request2->uri_with({ bar => [ 'snort', 'ewok' ] }, { mode => 'append' }), - 'http://127.0.0.1/foo/bar/baz?bar=gorch&bar=snort&bar=ewok', - 'append mode URI appends arrayref param' -); -