2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 16;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::inter::shlibs');
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 ########## ask; mock response to prompt ##########
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::shlibs};
32 $conf->add_steps($pkg);
34 my $serialized = $conf->pcfreeze();
36 $conf->options->set( %{$args} );
37 my $step = test_step_constructor_and_description($conf);
39 my ( @prompts, $prompt, $object );
41 push @prompts, $prompt;
43 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
44 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
45 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
48 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
49 my $ret = $step->runstep($conf);
50 close STDOUT or croak "Unable to close after myout";
51 ok( $ret, "runstep() returned true value" );
52 is( $step->result(), $prompt, "Expected result was set" );
59 $conf->replenish($serialized);
61 ########## ask; empty response to prompt ##########
63 ($args, $step_list_ref) = process_options(
69 $conf->options->set( %{$args} );
70 $step = test_step_constructor_and_description($conf);
72 push @prompts, $prompt;
74 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
75 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
76 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
79 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
80 my $ret = $step->runstep($conf);
81 close STDOUT or croak "Unable to close after myout";
82 ok( $ret, "runstep() returned true value" );
83 is( $step->result(), q{done}, "Expected result was set" );
90 pass("Completed all tests in $0");
92 ################### DOCUMENTATION ###################
96 inter/shlibs-01.t - test inter::shlibs
100 % prove t/steps/inter/shlibs-01.t
104 The files in this directory test functionality used by F<Configure.pl>.
106 The tests in this file test inter::shlibs.
114 config::inter::shlibs, F<Configure.pl>.
120 # cperl-indent-level: 4
123 # vim: expandtab shiftwidth=4: