tagged release 0.6.4
[parrot.git] / t / steps / auto_macports-02.t
blob6682edf25ac66d615b37d81c439d2e0441f15d03
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_macports-02.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 use_ok('config::auto::macports');
16 use Parrot::Configure;
17 use Parrot::Configure::Options qw( process_options );
18 use Parrot::Configure::Test qw( test_step_thru_runstep);
20 my $args = process_options( {
21     argv            => [],
22     mode            => q{configure},
23 } );
25 my $conf = Parrot::Configure->new();
27 test_step_thru_runstep($conf, q{init::defaults}, $args);
29 my ($task, $step_name, $step, $ret);
30 my $pkg = q{auto::macports};
32 $conf->add_steps($pkg);
33 $conf->options->set(%{$args});
34 $task = $conf->steps->[-1];
35 $step_name   = $task->step;
37 $step = $step_name->new();
38 ok(defined $step, "$step_name constructor returned defined value");
39 isa_ok($step, $step_name);
41 # mock no Macports-default directories
42 $step->{ports_root} = File::Spec->catdir( qw( / my ridiculous foobar ) );
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-02.t - test config::auto::macports
54 =head1 SYNOPSIS
56     % prove t/steps/auto_macports-02.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 default directories for Macports are 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: