tagged release 0.6.4
[parrot.git] / t / steps / auto_ctags-02.t
blobf2c58d6443faf1356fab9079cb52d42203d8803e
1 #!perl
2 # Copyright (C) 2001-2007, The Perl Foundation.
3 # $Id$
4 # auto_ctags-02.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  12;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 $ENV{TEST_CTAGS} = [ ( 'foobar' ) ];
13 use_ok('config::auto::ctags');
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 $pkg = q{auto::ctags};
32 $conf->add_steps($pkg);
33 $conf->options->set( %{$args} );
35 my ( $task, $step_name, $step);
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 );
45     my $stdout;
46     my $ret = capture(
47         sub { $step->runstep($conf) },
48         \$stdout
49     );
50     ok( $ret, "$step_name runstep() returned true value" );
51     is($step->result(), q{no}, "Got expected result");
52     is($conf->data->get('ctags'), 'ctags',
53         "Correct value for 'ctags' attribute was set");
57 pass("Completed all tests in $0");
59 ################### DOCUMENTATION ###################
61 =head1 NAME
63 t/steps/auto_ctags-02.t - tests Parrot::Configure step auto::ctags
65 =head1 SYNOPSIS
67     prove t/steps/auto_ctags-02.t
69 =head1 DESCRIPTION
71 Regression tests for the L<Parrot::Configure step auto::ctags> module.
72 This file holds tests for Parrot::Configure step auto::ctags::runstep()
73 (a non-exported subroutine).
75 =head1 AUTHOR
77 Paul Cochrane <paultcochrane at gmail dot com>
79 =cut
81 # Local Variables:
82 #   mode: cperl
83 #   cperl-indent-level: 4
84 #   fill-column: 100
85 # End:
86 # vim: expandtab shiftwidth=4: