tagged release 0.6.4
[parrot.git] / t / steps / auto_fink-03.t
blobfad4417a29064e14e54d2626b3abe8be2591f21a
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_fink-03.t
6 use strict;
7 use warnings;
8 use Test::More;
9 plan( skip_all => 'Fink is Darwin only' ) unless $^O =~ /darwin/;
10 plan( tests => 11 );
11 use Carp;
12 use lib qw( lib t/configure/testlib );
13 use_ok('config::init::defaults');
14 use_ok('config::auto::fink');
15 use Parrot::Configure;
16 use Parrot::Configure::Options qw( process_options );
17 use Parrot::Configure::Test qw( test_step_thru_runstep);
19 my $args = process_options( {
20     argv            => [],
21     mode            => q{configure},
22 } );
24 my $conf = Parrot::Configure->new();
26 test_step_thru_runstep($conf, q{init::defaults}, $args);
28 my ($task, $step_name, $step, $ret);
29 my $pkg = q{auto::fink};
31 $conf->add_steps($pkg);
32 $conf->options->set(%{$args});
33 $task = $conf->steps->[-1];
34 $step_name   = $task->step;
36 $step = $step_name->new();
37 ok(defined $step, "$step_name constructor returned defined value");
38 isa_ok($step, $step_name);
40 # mock no Fink
41 $step->{fink_conf} = q{my_ridiculous_foobar};
42 my $msg = q{Fink not installed};
43 ok($step->runstep($conf), "runstep() returned true value");
44 is($step->result(), $msg,
45     "Got expected result for $msg");
47 pass("Completed all tests in $0");
49 ################### DOCUMENTATION ###################
51 =head1 NAME
53 auto_fink-03.t - test config::auto::fink
55 =head1 SYNOPSIS
57     % prove t/steps/auto_fink-03.t
59 =head1 DESCRIPTION
61 The files in this directory test functionality used by F<Configure.pl>.
63 The tests in this file test config::auto::fink in the case where the OS is
64 Darwin but Fink is not installed.
66 =head1 AUTHOR
68 James E Keenan
70 =head1 SEE ALSO
72 config::auto::fink, F<Configure.pl>.
74 =cut
76 # Local Variables:
77 #   mode: cperl
78 #   cperl-indent-level: 4
79 #   fill-column: 100
80 # End:
81 # vim: expandtab shiftwidth=4: