diff _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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_test/Test/Web/AutoLocator.pm	Tue Jun 05 07:45:21 2012 +0400
@@ -0,0 +1,27 @@
+package Test::Web::AutoLocator;
+use strict;
+
+use IMPL::lang qw(:declare :constants);
+use IMPL::Test qw(test assert);
+use URI();
+
+use IMPL::declare {
+	require => {
+		'Locator' => 'IMPL::Web::AutoLocator'
+	},
+	base => {
+		'IMPL::Test::Unit' => '@_'
+	}
+};
+
+test TestCreation => sub {
+	my $location = Locator->new(base => 'http://bugs.company.org', view => "cgi");
+	
+	my $url = $location->show_bug({id => 100});
+	assert( $url->url eq "http://bugs.company.org/show_bug.cgi?id=100", $url->url );
+	
+	$url = $location->SetView(undef)->help->CreateBug->HowTo;
+	assert( $url->url eq "http://bugs.company.org/help/CreateBug/HowTo", $url->url );
+};
+
+1;
\ No newline at end of file