annotate _test/Test/Web/AutoLocator.pm @ 383:2f16f13b000c

DOM localization
author cin
date Thu, 23 Jan 2014 17:26:34 +0400
parents 5c82eec23bb6
children
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::Test qw(test assert);
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
5 use URI();
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
6
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
7 use IMPL::declare {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
8 require => {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
9 'Locator' => 'IMPL::Web::AutoLocator'
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
10 },
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
11 base => {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
12 'IMPL::Test::Unit' => '@_'
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
13 }
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 test TestCreation => sub {
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
17 my $location = Locator->new(base => 'http://bugs.company.org', view => "cgi");
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
18
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
19 my $url = $location->show_bug({id => 100});
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
20 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
21
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
22 $url = $location->SetView(undef)->help->CreateBug->HowTo;
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
23 assert( $url->url eq "http://bugs.company.org/help/CreateBug/HowTo", $url->url );
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
24 };
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
25
2b9b55cfb79b Completed IMPL::Web::AutoLocator, added tests
cin
parents:
diff changeset
26 1;