2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 12;
11 use lib qw( lib t/configure/testlib );
12 use_ok('config::init::defaults');
13 use_ok('config::init::hints');
14 use Parrot::Configure;
15 use Parrot::Configure::Options qw( process_options );
16 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 use IO::CaptureOutput qw | capture |;
19 my $args = process_options(
21 argv => [q{--verbose}],
26 my $conf = Parrot::Configure->new;
28 test_step_thru_runstep( $conf, q{init::defaults}, $args );
30 my ( $task, $step_name, $step, $ret );
31 my $pkg = q{init::hints};
33 $conf->add_steps($pkg);
34 $conf->options->set( %{$args} );
36 $task = $conf->steps->[-1];
37 $step_name = $task->step;
39 $step = $step_name->new();
40 ok( defined $step, "$step_name constructor returned defined value" );
41 isa_ok( $step, $step_name );
42 ok( $step->description(), "$step_name has description" );
44 # need to capture the --verbose output, because the fact that it does not end
45 # in a newline confuses Test::Harness
49 capture ( sub {$rv = $step->runstep($conf)}, \$stdout);
50 ok( $stdout, "verbose output: hints were captured" );
51 ok( defined $rv, "$step_name runstep() returned defined value" );
54 pass("Completed all tests in $0");
56 ################### DOCUMENTATION ###################
60 init_hints-01.t - test config::init::hints
64 % prove t/steps/init_hints-01.t
68 The files in this directory test functionality used by F<Configure.pl>.
70 The tests in this file test subroutines exported by config::init::hints.
78 config::init::hints, F<Configure.pl>.
84 # cperl-indent-level: 4
87 # vim: expandtab shiftwidth=4: