1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/usr/bin/perl -w
#
# Test that our URLs are "neat"
#
# Steve
# --
use strict;
use Test::More qw( no_plan );
#
# Find the file
#
my $file = undef;
foreach my $f ( qw! ../etc/rinse.conf ./etc/rinse.conf ! )
{
$file = $f if ( -e $f );
}
ok( $file, "Found configuration file" );
#
# Open the file
#
open( FILE, "<", $file ) or die "Failed to open $file - $!";
foreach my $line ( <FILE> )
{
next if ( !$line );
chomp( $line );
if( my ( $key , $val ) = split( /=/, $line ) )
{
next if ( !$val );
$val =~ s!http://!!g;
ok( $val !~ /\/\//, "URL is neat: $val" );
}
}
close ( FILE );
|