2 # Copyright (C) 2007, The Perl Foundation.
9 use Test::More tests => 7;
11 use lib qw( lib t/configure/testlib );
12 use Parrot::Configure;
13 use Parrot::Configure::Options qw( process_options );
14 use Parrot::Configure::Test qw( test_step_thru_runstep);
15 use IO::CaptureOutput qw | capture |;
18 'Parrot::Configure::Step::List', qw|
24 is( $|, 1, "output autoflush is set" );
26 my $testopt = q{bindir};
27 my $testoptval = q{mybindir};
29 my $args = process_options(
35 ok( defined $args, "process_options returned successfully" );
37 my $conf = Parrot::Configure->new;
38 ok( defined $conf, "Parrot::Configure->new() returned okay" );
40 my $step = q{init::foobar};
41 my $description = 'Determining if your computer does foobar';
43 $conf->add_steps($step);
44 $conf->options->set( %{$args} );
48 capture ( sub {$rv = $conf->runsteps}, \$stdout );
49 like( $stdout, qr/$description/s, "Got message expected upon running $step" );
50 ok( !defined( $conf->option_or_data($testopt) ),
51 "option_or_data returned undef; neither option nor data had been defined" );
54 pass("Completed all tests in $0");
56 ################### DOCUMENTATION ###################
60 030-option_or_data.t - test C<Parrot::Configure::option_or_data()>
64 % prove t/configure/030-option_or_data.t
68 The files in this directory test functionality used by F<Configure.pl>.
70 This file tests C<Parrot::Configure::option_or_data()> in the case where
71 no value for the tested option has been set on the command line but
72 where no value for the tested option has been located internally by a
81 Parrot::Configure, F<Configure.pl>.
87 # cperl-indent-level: 4
90 # vim: expandtab shiftwidth=4: