annotate _test/Test/Web/AutoLocator.pm @ 221:e997e6fbac0b

sync: working on resources schema
author sergey
date Fri, 24 Aug 2012 16:24:14 +0400
parents 2b9b55cfb79b
children 5c82eec23bb6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
211
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
1 package Test::Web::AutoLocator;
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
2 use strict;
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
3
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
4 use IMPL::lang qw(:declare :constants);
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
5 use IMPL::Test qw(test assert);
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
6 use URI();
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
7
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
8 use IMPL::declare {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
9 require => {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
10 'Locator' => 'IMPL::Web::AutoLocator'
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
11 },
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
12 base => {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
13 'IMPL::Test::Unit' => '@_'
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
14 }
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
15 };
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
16
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
17 test TestCreation => sub {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
18 my $location = Locator->new(base => 'http://bugs.company.org', view => "cgi");
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
19
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
20 my $url = $location->show_bug({id => 100});
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
21 assert( $url->url eq "http://bugs.company.org/show_bug.cgi?id=100", $url->url );
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
22
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
23 $url = $location->SetView(undef)->help->CreateBug->HowTo;
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
24 assert( $url->url eq "http://bugs.company.org/help/CreateBug/HowTo", $url->url );
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
25 };
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
26
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
27 1;