2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 12;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::inter::types');
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Step::Test;
14 use Parrot::Configure::Test qw(
15 test_step_constructor_and_description
17 use Tie::Filehandle::Preempt::Stdin;
19 ########## no ask ##########
21 my ($args, $step_list_ref) = process_options(
28 my $conf = Parrot::Configure::Step::Test->new;
29 $conf->include_config_results( $args );
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(
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" );
77 pass("Completed all tests in $0");
79 ################### DOCUMENTATION ###################
83 inter/types-01.t - test inter::types
87 % prove t/steps/inter/types-01.t
91 The files in this directory test functionality used by F<Configure.pl>.
93 The tests in this file test inter::types.
101 config::inter::types, F<Configure.pl>.
107 # cperl-indent-level: 4
110 # vim: expandtab shiftwidth=4: