tagged release 0.6.4
[parrot.git] / t / steps / auto_macports-06.t
blob2cd1f1f2f08c9c75ce969f7aa34e289850089de0
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_macports-06.t
6 use strict;
7 use warnings;
8 use Test::More;
9 plan( skip_all => 'Macports 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 $ENV{TEST_MACPORTS} = 'foobar';
15 use_ok('config::auto::macports');
17 use Parrot::Configure;
18 use Parrot::Configure::Options qw( process_options );
19 use Parrot::Configure::Test qw( test_step_thru_runstep);
21 my $args = process_options( {
22     argv            => [],
23     mode            => q{configure},
24 } );
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{auto::macports};
33 $conf->add_steps($pkg);
34 $conf->options->set(%{$args});
35 $task = $conf->steps->[-1];
36 $step_name   = $task->step;
38 $step = $step_name->new();
39 ok(defined $step, "$step_name constructor returned defined value");
40 isa_ok($step, $step_name);
42 # mock no Macports-default directories
43 ok($step->runstep($conf), "runstep() returned true value");
44 is($step->result(), 'no', "Got expected result");
46 pass("Completed all tests in $0");
48 ################### DOCUMENTATION ###################
50 =head1 NAME
52 auto_macports-06.t - test config::auto::macports
54 =head1 SYNOPSIS
56     % prove t/steps/auto_macports-06.t
58 =head1 DESCRIPTION
60 The files in this directory test functionality used by F<Configure.pl>.
62 The tests in this file test config::auto::macports by mocking the case where
63 the root directory for Macports is not located.
65 =head1 AUTHOR
67 James E Keenan
69 =head1 SEE ALSO
71 config::auto::macports, F<Configure.pl>.
73 =cut
75 # Local Variables:
76 #   mode: cperl
77 #   cperl-indent-level: 4
78 #   fill-column: 100
79 # End:
80 # vim: expandtab shiftwidth=4: