[cage] Update release manager guide about committing to trunk near a release, based...
[parrot.git] / t / steps / inter / types-01.t
blobaef41af2eacb9c5483b024f3c1269464c4656384
1 #! perl
2 # Copyright (C) 2007, Parrot Foundation.
3 # $Id$
4 # inter/types-01.t
6 use strict;
7 use warnings;
8 use Test::More tests => 12;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::inter::types');
12 use Parrot::Configure;
13 use Parrot::Configure::Options qw( process_options );
14 use Parrot::Configure::Test qw(
15     test_step_thru_runstep
16     test_step_constructor_and_description
18 use Tie::Filehandle::Preempt::Stdin;
20 ########## no ask ##########
22 my ($args, $step_list_ref) = process_options(
23     {
24         argv => [],
25         mode => q{configure},
26     }
29 my $conf = Parrot::Configure->new;
31 my $pkg = q{inter::types};
33 $conf->add_steps($pkg);
35 my $serialized = $conf->pcfreeze();
37 $conf->options->set( %{$args} );
38 my $step = test_step_constructor_and_description($conf);
39 my $ret = $step->runstep($conf);
40 ok( $ret, "runstep() returned true value" );
42 $conf->replenish($serialized);
44 ########## ask ##########
46 ($args, $step_list_ref) = process_options(
47     {
48         argv => [q{--ask}],
49         mode => q{configure},
50     }
52 $conf->options->set( %{$args} );
53 $step = test_step_constructor_and_description($conf);
55 my ( @prompts, $object );
57 $conf->options->set('intval' => 'alpha');
58 $conf->options->set('floatval' => 'beta');
59 $conf->options->set('opcode' => 'gamma');
60 @prompts = qw( delta epsilon zeta );
62 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
63 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
64 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
67     open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
68     my $ret = $step->runstep($conf);
69     close STDOUT or croak "Unable to close after myout";
70     ok( $ret, "runstep() returned true value" );
73 undef $object;
74 untie *STDIN;
75 @prompts = ();
77 pass("Completed all tests in $0");
79 ################### DOCUMENTATION ###################
81 =head1 NAME
83 inter/types-01.t - test inter::types
85 =head1 SYNOPSIS
87     % prove t/steps/inter/types-01.t
89 =head1 DESCRIPTION
91 The files in this directory test functionality used by F<Configure.pl>.
93 The tests in this file test inter::types.
95 =head1 AUTHOR
97 James E Keenan
99 =head1 SEE ALSO
101 config::inter::types, F<Configure.pl>.
103 =cut
105 # Local Variables:
106 #   mode: cperl
107 #   cperl-indent-level: 4
108 #   fill-column: 100
109 # End:
110 # vim: expandtab shiftwidth=4: