~ubuntu-branches/debian/jessie/rinse/jessie

« back to all changes in this revision

Viewing changes to tests/urls.t

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kemp
  • Date: 2008-06-28 21:22:23 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080628212223-mteb47q7aocea9uy
Tags: 1.3-2
* Removed several "bashisms" from our scripts
  - Thanks for Ubuntu for the patch / feedback.
  (Closes: #488356)

Show diffs side-by-side

added added

removed removed

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