2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 17;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::inter::charset');
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 ##########
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::charset};
36 $conf->add_steps($pkg);
38 my $serialized = $conf->pcfreeze();
40 $conf->options->set( %{$args} );
41 my $step = test_step_constructor_and_description($conf);
43 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
44 my $ret = $step->runstep($conf);
45 close STDOUT or croak "Unable to close after myout";
46 ok( $ret, "runstep() returned true value" );
49 $conf->replenish($serialized);
51 ########## ask ##########
53 ($args, $step_list_ref) = process_options(
59 $conf->options->set( %{$args} );
60 $step = test_step_constructor_and_description($conf);
62 my ( @prompts, $object );
64 $conf->options->set('intval' => 'alpha');
65 $conf->options->set('floatval' => 'beta');
66 $conf->options->set('opcode' => 'gamma');
67 @prompts = qw( delta epsilon zeta );
69 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
70 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
71 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
74 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
75 my $ret = $step->runstep($conf);
76 close STDOUT or croak "Unable to close after myout";
77 ok( $ret, "runstep() returned true value" );
84 pass("Completed all tests in $0");
86 ################### DOCUMENTATION ###################
90 inter/charset-01.t - test inter::charset
94 % prove t/steps/inter/charset-01.t
98 The files in this directory test functionality used by F<Configure.pl>.
100 The tests in this file test inter::charset.
108 config::inter::charset, F<Configure.pl>.
114 # cperl-indent-level: 4
117 # vim: expandtab shiftwidth=4: