tagged release 0.6.4
[parrot.git] / t / steps / init_hints-01.t
blob602a9cf0eef05e98f9567d419c3a180531fb2faf
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # init_hints-01.t
6 use strict;
7 use warnings;
8 use Test::More tests => 12;
9 use Carp;
10 use Data::Dumper;
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(
20     {
21         argv => [q{--verbose}],
22         mode => q{configure},
23     }
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
47     my $rv;
48     my $stdout;
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 ###################
58 =head1 NAME
60 init_hints-01.t - test config::init::hints
62 =head1 SYNOPSIS
64     % prove t/steps/init_hints-01.t
66 =head1 DESCRIPTION
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.
72 =head1 AUTHOR
74 James E Keenan
76 =head1 SEE ALSO
78 config::init::hints, F<Configure.pl>.
80 =cut
82 # Local Variables:
83 #   mode: cperl
84 #   cperl-indent-level: 4
85 #   fill-column: 100
86 # End:
87 # vim: expandtab shiftwidth=4: