2 # Copyright (C) 2007, Parrot Foundation.
9 use Test::More tests => 6;
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 Parrot::Configure::Step::List qw( get_steps_list );
16 use IO::CaptureOutput qw | capture |;
19 is( $|, 1, "output autoflush is set" );
21 my $testopt = q{bindir};
22 my $testoptval = q{mybindir};
24 my ($args, $step_list_ref) = process_options(
30 ok( defined $args, "process_options returned successfully" );
32 my $conf = Parrot::Configure->new;
33 ok( defined $conf, "Parrot::Configure->new() returned okay" );
35 my $step = q{init::foobar};
36 my $description = 'Determining if your computer does foobar';
38 $conf->add_steps($step);
39 $conf->options->set( %{$args} );
43 capture ( sub {$rv = $conf->runsteps}, \$stdout );
44 like( $stdout, qr/$description/s, "Got message expected upon running $step" );
45 ok( !defined( $conf->option_or_data($testopt) ),
46 "option_or_data returned undef; neither option nor data had been defined" );
49 pass("Completed all tests in $0");
51 ################### DOCUMENTATION ###################
55 030-option_or_data.t - test C<Parrot::Configure::option_or_data()>
59 % prove t/configure/030-option_or_data.t
63 The files in this directory test functionality used by F<Configure.pl>.
65 This file tests C<Parrot::Configure::option_or_data()> in the case where
66 no value for the tested option has been set on the command line but
67 where no value for the tested option has been located internally by a
76 Parrot::Configure, F<Configure.pl>.
82 # cperl-indent-level: 4
85 # vim: expandtab shiftwidth=4: