2 # Copyright (C) 2007, Parrot Foundation.
9 use Test::More tests => 12;
12 use config::init::defaults;
13 use config::init::install;
14 use Parrot::Configure;
15 use Parrot::Configure::Options qw( process_options );
16 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 use Parrot::Configure::Step::List qw( get_steps_list );
20 is( $|, 1, "output autoflush is set" );
22 my $testopt = q{bindir};
23 my $testoptval = q{mybindir};
25 my ($args, $step_list_ref) = process_options(
31 ok( defined $args, "process_options returned successfully" );
33 my $conf = Parrot::Configure->new;
35 test_step_thru_runstep( $conf, q{init::defaults}, $args );
37 my ( $task, $step_name, $step, $ret );
38 my $pkg = q{init::install};
40 $conf->add_steps($pkg);
41 $conf->options->set( %{$args} );
43 $task = $conf->steps->[1];
44 $step_name = $task->step;
46 $step = $step_name->new();
47 ok( defined $step, "$step_name constructor returned defined value" );
48 isa_ok( $step, $step_name );
49 ok( $step->description(), "$step_name has description" );
50 $ret = $step->runstep($conf);
51 ok( defined $ret, "$step_name runstep() returned defined value" );
53 my $val = $conf->option_or_data($testopt);
56 $conf->data->get($testopt),
57 'option_or_data() returned expected value when no option provided'
60 pass("Completed all tests in $0");
62 ################### DOCUMENTATION ###################
66 028-option_or_data.t - test C<Parrot::Configure::option_or_data()>
70 % prove t/configure/028-option_or_data.t
74 The files in this directory test functionality used by F<Configure.pl>.
76 This file tests C<Parrot::Configure::option_or_data()> in the case where
77 no value for the tested option has been set on the command line but a
78 value for the tested option has been located internally by a
87 Parrot::Configure, F<Configure.pl>.
93 # cperl-indent-level: 4
96 # vim: expandtab shiftwidth=4: