comparison _test/Test/Web/AutoLocator.pm @ 211:2b9b55cfb79b

Completed IMPL::Web::AutoLocator, added tests
author cin
date Tue, 05 Jun 2012 07:45:21 +0400
parents
children 5c82eec23bb6
comparison
equal deleted inserted replaced
210:6adaeb86945d 211:2b9b55cfb79b
1 package Test::Web::AutoLocator;
2 use strict;
3
4 use IMPL::lang qw(:declare :constants);
5 use IMPL::Test qw(test assert);
6 use URI();
7
8 use IMPL::declare {
9 require => {
10 'Locator' => 'IMPL::Web::AutoLocator'
11 },
12 base => {
13 'IMPL::Test::Unit' => '@_'
14 }
15 };
16
17 test TestCreation => sub {
18 my $location = Locator->new(base => 'http://bugs.company.org', view => "cgi");
19
20 my $url = $location->show_bug({id => 100});
21 assert( $url->url eq "http://bugs.company.org/show_bug.cgi?id=100", $url->url );
22
23 $url = $location->SetView(undef)->help->CreateBug->HowTo;
24 assert( $url->url eq "http://bugs.company.org/help/CreateBug/HowTo", $url->url );
25 };
26
27 1;