~ubuntu-branches/ubuntu/trusty/libclass-inspector-perl/trusty

« back to all changes in this revision

Viewing changes to t/99_author.t

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2007-08-13 22:56:10 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070813225610-5hk4rqc4a5rumxch
Tags: 1.17-1
* New upstream release
* [debian/control]
  + Dropped libtest-pod-perl from B-D
  + Added myself to Uploaders: (and wrapped that)
* Update copyright years and author's email in debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
BEGIN {
 
5
        $|  = 1;
 
6
        $^W = 1;
 
7
}
 
8
use Test::More;
 
9
 
 
10
# Skip if doing a regular install
 
11
unless ( $ENV{AUTOMATED_TESTING} ) {
 
12
        plan( skip_all => "Author tests not required for installation" );
 
13
}
 
14
 
 
15
# Load the testing modules
 
16
eval "use Test::Pod 1.00";
 
17
 
 
18
# Can we run the version tests
 
19
eval "use Test::MinimumVersion;";
 
20
 
 
21
 
 
22
 
 
23
 
 
24
 
 
25
#####################################################################
 
26
# WARNING: INSANE BLACK MAGIC
 
27
#####################################################################
 
28
 
 
29
# Hack Pod::Simple::BlackBox to ignore the Test::Inline
 
30
# "Extended Begin" syntax.
 
31
# For example, "=begin has more than one word errors"
 
32
my $begin;
 
33
if ( $Test::Pod::VERSION ) {
 
34
        $begin = \&Pod::Simple::BlackBox::_ponder_begin;
 
35
}
 
36
sub mybegin {
 
37
        my $para = $_[1];
 
38
        my $content = join ' ', splice @$para, 2;
 
39
        $content =~ s/^\s+//s;
 
40
        $content =~ s/\s+$//s;
 
41
        my @words = split /\s+/, $content;
 
42
        if ( $words[0] =~ /^test(?:ing)?\z/s ) {
 
43
                foreach ( 2 .. $#$para ) {
 
44
                        $para->[$_] = '';
 
45
                }
 
46
                $para->[2] = $words[0];
 
47
        }
 
48
 
 
49
        # Continue as normal
 
50
        push @$para, @words;
 
51
        return &$begin(@_);
 
52
}
 
53
 
 
54
SCOPE: {
 
55
        local $^W = 0;
 
56
        if ( $Test::Pod::VERSION ) {
 
57
                *Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
 
58
        }
 
59
}
 
60
 
 
61
#####################################################################
 
62
# END BLACK MAGIC
 
63
#####################################################################
 
64
 
 
65
plan( 'no_plan' );
 
66
ok( 1, "Running author tests" );
 
67
 
 
68
# Test POD
 
69
if ( $Test::Pod::VERSION ) {
 
70
        all_pod_files_ok();
 
71
}
 
72
 
 
73
# Test version
 
74
if ( $Test::MinimumVersion::VERSION and $Test::MinimumVersion::VERSION > 0.05 ) {
 
75
        all_minimum_version_from_metayml_ok();
 
76
}