2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 15;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::auto::revision');
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
18 ########## regular ##########
20 my ($args, $step_list_ref) = process_options(
27 my $conf = Parrot::Configure::Step::Test->new;
28 $conf->include_config_results( $args );
30 my $pkg = q{auto::revision};
32 $conf->add_steps($pkg);
33 $conf->options->set( %{$args} );
34 my $step = test_step_constructor_and_description($conf);
39 local $Parrot::Revision::current = $testrev;
40 $ret = $step->runstep($conf);
41 ok( $ret, "runstep() returned true value" );
42 is($conf->data->get('revision'), $testrev,
43 "'revision' element was set correctly");
44 is($step->result(), qq{r$testrev}, "Expected result was set");
49 local $Parrot::Revision::current = $testrev;
50 $ret = $step->runstep($conf);
51 ok( $ret, "runstep() returned true value" );
52 is($conf->data->get('revision'), $testrev,
53 "'revision' element was set correctly");
54 is($step->result(), q{done}, "Expected result was set");
59 local $Parrot::Revision::current = $testrev;
60 eval { $ret = $step->runstep($conf); };
61 like($@, qr/Cannot use non-numeric revision number/,
62 "Got expected error message");
67 local $Parrot::Revision::current = $testrev;
68 $ret = $step->runstep($conf);
69 ok( $ret, "runstep() returned true value" );
70 ok(! defined($conf->data->get('revision')),
71 "'revision' element is undefined as expected");
72 is($step->result(), q{done}, "Expected result was set");
75 pass("Completed all tests in $0");
77 ################### DOCUMENTATION ###################
81 auto/revision-01.t - test auto::revision
85 % prove t/steps/auto/revision-01.t
89 The files in this directory test functionality used by F<Configure.pl>.
91 The tests in this file test auto::revision.
99 config::auto::revision, F<Configure.pl>.
105 # cperl-indent-level: 4
108 # vim: expandtab shiftwidth=4: