tagged release 0.6.4
[parrot.git] / t / steps / inter_lex-01.t
blobfd740ec153846bc585f23688b1fdd33a7010f68b
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # inter_lex-01.t
6 use strict;
7 use warnings;
8 use Test::More tests => 12;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::inter::lex');
13 use Parrot::Configure;
14 use Parrot::Configure::Options qw( process_options );
15 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 my $args = process_options(
18     {
19         argv => [q{--ask}],
20         mode => q{configure},
21     }
24 my $conf = Parrot::Configure->new();
26 test_step_thru_runstep( $conf, q{init::defaults}, $args );
28 my ( $task, $step_name, $step, $ret );
29 my $pkg = q{inter::lex};
31 $conf->add_steps($pkg);
32 $conf->options->set( %{$args} );
33 $task        = $conf->steps->[-1];
34 $step_name   = $task->step;
36 $step = $step_name->new();
37 ok( defined $step, "$step_name constructor returned defined value" );
38 isa_ok( $step, $step_name );
39 ok( $step->description(), "$step_name has description" );
40 $ret = $step->runstep($conf);
41 ok( defined $ret, "$step_name runstep() returned defined value" );
42 is( $step->result(), q{skipped}, "Step was skipped as expected; no '--maintainer' option" );
44 pass("Completed all tests in $0");
46 ################### DOCUMENTATION ###################
48 =head1 NAME
50 inter_lex-01.t - test config::inter::lex
52 =head1 SYNOPSIS
54     % prove t/steps/inter_lex-01.t
56 =head1 DESCRIPTION
58 The files in this directory test functionality used by F<Configure.pl>.
60 The tests in this file test subroutines exported by config::inter::lex.  In
61 this case, only the C<--ask> option is provided.  Because the C<--maintainer>
62 option is not provided, the step is skipped and no prompt is ever reached.
64 =head1 AUTHOR
66 James E Keenan
68 =head1 SEE ALSO
70 config::inter::lex, F<Configure.pl>.
72 =cut
74 # Local Variables:
75 #   mode: cperl
76 #   cperl-indent-level: 4
77 #   fill-column: 100
78 # End:
79 # vim: expandtab shiftwidth=4: