2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 18;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::auto::isreg');
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Step::Test;
14 use Parrot::Configure::Test qw(
15 test_step_constructor_and_description
17 use IO::CaptureOutput qw| capture |;
19 ########## regular ##########
21 my ($args, $step_list_ref) = process_options( {
26 my $conf = Parrot::Configure::Step::Test->new;
27 $conf->include_config_results( $args );
29 my $pkg = q{auto::isreg};
31 $conf->add_steps($pkg);
33 my $serialized = $conf->pcfreeze();
35 $conf->options->set(%{$args});
36 my $step = test_step_constructor_and_description($conf);
37 ok($step->runstep($conf), "runstep() returned true value");
39 $conf->replenish($serialized);
41 ########## _evaluate_isreg() ##########
43 $conf->options->set(%{$args});
44 $step = test_step_constructor_and_description($conf);
49 sub { $step->_evaluate_isreg($conf, $anyerror) },
52 ok($ret, "_evaluate_isreg returned true value");
53 is($conf->data->get('isreg'), 1, "'isreg' set to true value as expected");
54 is($step->result, 'yes', "Got expected result");
57 $conf->replenish($serialized);
59 ########## _evaluate_isreg(); --verbose ##########
61 ($args, $step_list_ref) = process_options( {
62 argv => [ q{--verbose} ],
65 $conf->options->set(%{$args});
66 $step = test_step_constructor_and_description($conf);
71 sub { $step->_evaluate_isreg($conf, $anyerror) },
74 ok($ret, "_evaluate_isreg returned true value");
75 is($conf->data->get('isreg'), 0, "'isreg' set to false value as expected");
76 is($step->result, 'no', "Got expected result");
79 pass("Completed all tests in $0");
81 ################### DOCUMENTATION ###################
85 auto/isreg-01.t - test auto::isreg
89 % prove t/steps/auto/isreg-01.t
93 The files in this directory test functionality used by F<Configure.pl>.
95 The tests in this file test auto::isreg.
103 config::auto::isreg, F<Configure.pl>.
109 # cperl-indent-level: 4
112 # vim: expandtab shiftwidth=4: