2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 12;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 $ENV{TEST_CHARSET} = 'ascii.c';
13 use_ok('config::inter::charset');
14 use Parrot::Configure;
15 use Parrot::Configure::Options qw( process_options );
16 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 use Tie::Filehandle::Preempt::Stdin;
19 my $args = process_options(
26 my $conf = Parrot::Configure->new;
28 test_step_thru_runstep( $conf, q{init::defaults}, $args );
30 my $pkg = q{inter::charset};
32 $conf->add_steps($pkg);
33 $conf->options->set( %{$args} );
35 my ( $task, $step_name, $step);
36 $task = $conf->steps->[-1];
37 $step_name = $task->step;
39 $step = $step_name->new();
40 ok( defined $step, "$step_name constructor returned defined value" );
41 isa_ok( $step, $step_name );
44 my ( @prompts, $prompt, $object );
46 $prompt = $ENV{TEST_CHARSET};
47 push @prompts, $prompt;
49 $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
50 can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
51 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
54 open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
55 my $ret = $step->runstep($conf);
56 close STDOUT or croak "Unable to close after myout";
57 ok( $ret, "$step_name runstep() returned true value" );
63 pass("Completed all tests in $0");
65 ################### DOCUMENTATION ###################
69 inter_charset-02.t - test config::inter::charset
73 % prove t/steps/inter_charset-02.t
77 The files in this directory test functionality used by F<Configure.pl>.
79 The tests in this file test subroutines exported by config::inter::charset.
87 config::inter::charset, F<Configure.pl>.
93 # cperl-indent-level: 4
96 # vim: expandtab shiftwidth=4: