Author: bob Date: 2012-04-05 09:04:20 +0100 (Thu, 05 Apr 2012) New Revision: 1324
Modified: branches/rel_0_66/t/25_write_geo_data.t branches/rel_0_66/t/26_geo_data_search_form.t branches/rel_0_66/t/27_geo_data_edit_form.t branches/rel_0_66/t/33_search_advanced_search.t branches/rel_0_66/t/33_search_advanced_search_utm.t branches/rel_0_66/t/34_search_paging.t branches/rel_0_66/t/35_search_two_searches.t branches/rel_0_66/t/38_search_params.t branches/rel_0_66/t/39_search_form.t branches/rel_0_66/t/62_bug_trailing_whitespace.t branches/rel_0_66/t/66_bug_latlong_representation.t branches/rel_0_66/t/69_bug_zero_geo.t Log: now we require all 3 Geo Modules we should no longer skip tests if any of them are missing.
Modified: branches/rel_0_66/t/25_write_geo_data.t =================================================================== --- branches/rel_0_66/t/25_write_geo_data.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/25_write_geo_data.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -16,25 +16,6 @@ plan skip_all => "Plucene not installed"; }
-# Strictly speaking we don't need to skip _all_ tests if we don't have -# the modules below. Revisit this when not in a hurry. -# We only actually need the former two for the National Grid tests and the -# latter for the UTM tests. -eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -} - -eval { require Geo::Coordinates::ITM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::ITM not installed"; -} - -eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 53;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/26_geo_data_search_form.t =================================================================== --- branches/rel_0_66/t/26_geo_data_search_form.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/26_geo_data_search_form.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -20,25 +20,6 @@ plan skip_all => "Test::HTML::Content not installed"; }
-# Strictly speaking we don't need to skip _all_ tests if we don't have -# the modules below. Revisit this when not in a hurry. -# We only actually need the former two for the National Grid tests and the -# latter for the UTM tests. -eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -} - -eval { require Geo::Coordinates::ITM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::ITM not installed"; -} - -eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 12;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/27_geo_data_edit_form.t =================================================================== --- branches/rel_0_66/t/27_geo_data_edit_form.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/27_geo_data_edit_form.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -20,25 +20,6 @@ plan skip_all => "Test::HTML::Content not installed"; }
-# Strictly speaking we don't need to skip _all_ tests if we don't have -# the modules below. Revisit this when not in a hurry. -# We only actually need the former two for the National Grid tests and the -# latter for the UTM tests. -eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -} - -eval { require Geo::Coordinates::ITM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::ITM not installed"; -} - -eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 18;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/33_search_advanced_search.t =================================================================== --- branches/rel_0_66/t/33_search_advanced_search.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/33_search_advanced_search.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -17,10 +17,6 @@ plan skip_all => "Plucene not installed"; }
-eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -}
plan tests => 8;
Modified: branches/rel_0_66/t/33_search_advanced_search_utm.t =================================================================== --- branches/rel_0_66/t/33_search_advanced_search_utm.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/33_search_advanced_search_utm.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -16,11 +16,6 @@ plan skip_all => "Plucene not installed"; }
-eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 4;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/34_search_paging.t =================================================================== --- branches/rel_0_66/t/34_search_paging.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/34_search_paging.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -28,9 +28,6 @@ my $guide = OpenGuides->new( config => $config );
# Test with OS co-ords. -eval { require Geo::Coordinates::OSGB; }; -SKIP: { - skip "Geo::Coordinates::OSGB not installed", 6 if $@; $config->geo_handler( 1 );
foreach my $i ( 1 .. 50 ) { @@ -64,12 +61,8 @@ "os_y retained in previous page link" ); like( $output, qr/search.cgi?.*os_dist=1500.*Previous.*results/s, "os_dist retained in previous page link" ); -}
# Test with OSIE co-ords. -eval { require Geo::Coordinates::ITM; }; -SKIP: { - skip "Geo::Coordinates::ITM not installed", 6 if $@;
# We must create a new search object after changing the geo_handler # in order to force it to create a fresh locator. @@ -106,12 +99,8 @@ "osie_y retained in previous page link" ); like( $output, qr/search.cgi?.*osie_dist=1500.*Previous.*results/s, "osie_dist retained in previous page link" ); -}
# Test with UTM. -eval { require Geo::Coordinates::UTM; }; -SKIP: { - skip "Geo::Coordinates::UTM not installed", 6 if $@;
# We must create a new search object after changing the geo_handler # in order to force it to create a fresh locator. @@ -148,4 +137,3 @@ "longitude retained in previous page link" ); like( $output, qr/search.cgi?.*latlong_dist=1500.*Previous.*results/s, "latlong_dist retained in previous page link" ); -}
Modified: branches/rel_0_66/t/35_search_two_searches.t =================================================================== --- branches/rel_0_66/t/35_search_two_searches.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/35_search_two_searches.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -16,25 +16,7 @@ plan skip_all => "Plucene not installed"; }
-# Strictly speaking we don't need to skip _all_ tests if we don't have -# the modules below. Revisit this when not in a hurry. -# We only actually need the former two for the National Grid tests and the -# latter for the UTM tests. -eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -}
-eval { require Geo::Coordinates::ITM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::ITM not installed"; -} - -eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 10;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/38_search_params.t =================================================================== --- branches/rel_0_66/t/38_search_params.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/38_search_params.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -17,25 +17,6 @@ plan skip_all => "Plucene not installed"; }
-# Strictly speaking we don't need to skip _all_ tests if we don't have -# the modules below. Revisit this when not in a hurry. -# We only actually need the former two for the National Grid tests and the -# latter for the UTM tests. -eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -} - -eval { require Geo::Coordinates::ITM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::ITM not installed"; -} - -eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 19;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/39_search_form.t =================================================================== --- branches/rel_0_66/t/39_search_form.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/39_search_form.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -20,25 +20,6 @@ plan skip_all => "Test::HTML::Content not installed"; }
-# Strictly speaking we don't need to skip _all_ tests if we don't have -# the modules below. Revisit this when not in a hurry. -# We only actually need the former two for the National Grid tests and the -# latter for the UTM tests. -eval { require Geo::Coordinates::OSGB; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::OSGB not installed"; -} - -eval { require Geo::Coordinates::ITM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::ITM not installed"; -} - -eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -} - plan tests => 27;
# Clear out the database from any previous runs.
Modified: branches/rel_0_66/t/62_bug_trailing_whitespace.t =================================================================== --- branches/rel_0_66/t/62_bug_trailing_whitespace.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/62_bug_trailing_whitespace.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -21,10 +21,6 @@ my $config = OpenGuides::Test->make_basic_config; my $guide = OpenGuides->new( config => $config );
-SKIP: { - eval { require Geo::Coordinates::OSGB; }; - skip "Geo::Coordinates::OSGB not installed", 2 if $@; - my $q = CGI->new( "" ); $q->param( -name => "os_x", -value => " 123456 " ); $q->param( -name => "os_y", -value => " 654321 " ); @@ -40,12 +36,9 @@ is( $metadata_vars{os_x}, "123456", "leading and trailing spaces stripped from os_x when processed" ); is( $metadata_vars{os_y}, "654321", "...and os_y" ); -}
-SKIP: { - eval { require Geo::Coordinates::ITM; }; - skip "Geo::Coordinates::ITM not installed", 2 if $@;
+ $config->geo_handler( 2 ); my $q = CGI->new( "" ); $q->param( -name => "osie_x", -value => " 100000 " ); @@ -62,12 +55,7 @@ is( $metadata_vars{osie_x}, "100000", "leading and trailing spaces stripped from osie_x when processed" ); is( $metadata_vars{osie_y}, "200000", "...and osie_y" ); -}
-SKIP: { - eval { require Geo::Coordinates::UTM; }; - skip "Geo::Coordinates::UTM not installed", 2 if $@; - $config->geo_handler( 3 ); my $q = CGI->new( "" ); $q->param( -name => "latitude", -value => " 1.463113 " ); @@ -84,7 +72,6 @@ is( $metadata_vars{latitude}, "1.463113", "leading and trailing spaces stripped from latitude when processed" ); is( $metadata_vars{longitude}, "-0.215293", "...and longitude" ); -}
OpenGuides::Test->write_data( guide => $guide,
Modified: branches/rel_0_66/t/66_bug_latlong_representation.t =================================================================== --- branches/rel_0_66/t/66_bug_latlong_representation.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/66_bug_latlong_representation.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -13,10 +13,6 @@ plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)"; }
-eval { require Geo::Coordinates::UTM; }; -if ( $@ ) { - plan skip_all => "Geo::Coordinates::UTM not installed"; -}
plan tests => 4;
Modified: branches/rel_0_66/t/69_bug_zero_geo.t =================================================================== --- branches/rel_0_66/t/69_bug_zero_geo.t 2012-04-05 07:37:12 UTC (rev 1323) +++ branches/rel_0_66/t/69_bug_zero_geo.t 2012-04-05 08:04:20 UTC (rev 1324) @@ -50,9 +50,7 @@
is( @{$details{metadata}->{os_x}}[0], 0, "Zero os_x saved" ); is( @{$details{metadata}->{os_y}}[0], 0, "Zero os_y saved" ); -SKIP: { - eval { require Geo::Coordinates::ITM; }; - skip "Geo::Coordinates::ITM is not installed", 2 if $@; + $config->{geo_handler} = 2;
Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } ); @@ -76,7 +74,6 @@
is( @{$details{metadata}->{osie_x}}[0], 0, "Zero osie_x saved" ); is( @{$details{metadata}->{osie_y}}[0], 0, "Zero osie_y saved" ); -} $config->{geo_handler} = 3;
Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );