Author: jkeenan Date: Sat Apr 5 07:18:16 2008 New Revision: 26772 Modified: branches/ports/t/steps/auto_ports-01.t
Log: Add test to guarantee that auto::ports is skipped on non-Darwin OSes. Modified: branches/ports/t/steps/auto_ports-01.t ============================================================================== --- branches/ports/t/steps/auto_ports-01.t (original) +++ branches/ports/t/steps/auto_ports-01.t Sat Apr 5 07:18:16 2008 @@ -0,0 +1,80 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# auto_ports-01.t + +use strict; +use warnings; +use Test::More tests => 12; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::ports'); + +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( { + argv => [], + mode => q{configure}, +} ); + +my $conf = Parrot::Configure->new(); + +test_step_thru_runstep($conf, q{init::defaults}, $args); + +my ($task, $step_name, $step, $ret); +my $pkg = q{auto::ports}; + +$conf->add_steps($pkg); +$conf->options->set(%{$args}); +$task = $conf->steps->[-1]; +$step_name = $task->step; + +$step = $step_name->new(); +ok(defined $step, "$step_name constructor returned defined value"); +isa_ok($step, $step_name); +ok($step->description(), "$step_name has description"); + +# mock not Darwin +$conf->data->set_p5( 'OSNAME' => 'foobar' ); +ok($step->runstep($conf), "runstep() returned true value"); +is($step->result(), q{skipped}, "Got expected result for non-Darwin OS"); + +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +auto_ports-01.t - test config::auto::ports + +=head1 SYNOPSIS + + % prove t/steps/auto_ports-01.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::ports in the case where the OS is not +Darwin. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::ports, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: +