2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 21;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::inter::shlibs');
13 use Parrot::Configure;
14 use Parrot::Configure::Options qw( process_options );
15 use Parrot::Configure::Test qw(
16 test_step_thru_runstep
17 test_step_constructor_and_description
19 use Tie::Filehandle::Preempt::Stdin;
21 ########## ask; mock response to prompt ##########
23 my ($args, $step_list_ref) = process_options(
30 my $conf = Parrot::Configure->new;
32 test_step_thru_runstep( $conf, q{init::defaults}, $args );
34 my $pkg = q{inter::shlibs};
35 $conf->add_steps($pkg);
37 my $serialized = $conf->pcfreeze();
39 $conf->options->set( %{$args} );
40 my $step = test_step_constructor_and_description($conf);
42 my ( @prompts, $prompt, $object );
44 push @prompts, $prompt;
46 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
47 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
48 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
51 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
52 my $ret = $step->runstep($conf);
53 close STDOUT or croak "Unable to close after myout";
54 ok( $ret, "runstep() returned true value" );
55 is( $step->result(), $prompt, "Expected result was set" );
62 $conf->replenish($serialized);
64 ########## ask; empty response to prompt ##########
66 ($args, $step_list_ref) = process_options(
72 $conf->options->set( %{$args} );
73 $step = test_step_constructor_and_description($conf);
75 push @prompts, $prompt;
77 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
78 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
79 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
82 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
83 my $ret = $step->runstep($conf);
84 close STDOUT or croak "Unable to close after myout";
85 ok( $ret, "runstep() returned true value" );
86 is( $step->result(), q{done}, "Expected result was set" );
93 pass("Completed all tests in $0");
95 ################### DOCUMENTATION ###################
99 inter/shlibs-01.t - test inter::shlibs
103 % prove t/steps/inter/shlibs-01.t
107 The files in this directory test functionality used by F<Configure.pl>.
109 The tests in this file test inter::shlibs.
117 config::inter::shlibs, F<Configure.pl>.
123 # cperl-indent-level: 4
126 # vim: expandtab shiftwidth=4: