Commit | Line | Data |
f7c69158 |
1 | #!/usr/bin/perl -w |
2 | |
3 | BEGIN { |
f7c69158 |
4 | unshift @INC, 't/lib'; |
f7c69158 |
5 | } |
6 | |
7 | use strict; |
8 | use vars qw(%INIT %CUSTOM); |
9 | |
10 | use Test::More tests => 11; |
fbd6575c |
11 | use File::Spec::Functions qw( catfile updir ); |
f7c69158 |
12 | use TAP::Parser; |
13 | |
14 | use_ok('MySource'); |
15 | use_ok('MyPerlSource'); |
16 | use_ok('MyGrammar'); |
17 | use_ok('MyIteratorFactory'); |
18 | use_ok('MyResultFactory'); |
19 | |
2adbc9b6 |
20 | my $source = catfile( 't', 'source_tests', 'source' ); |
f7c69158 |
21 | my %customize = ( |
22 | source_class => 'MySource', |
23 | perl_source_class => 'MyPerlSource', |
24 | grammar_class => 'MyGrammar', |
25 | iterator_factory_class => 'MyIteratorFactory', |
26 | result_factory_class => 'MyResultFactory', |
27 | ); |
28 | my $p = TAP::Parser->new( |
29 | { source => $source, |
30 | %customize, |
31 | } |
32 | ); |
33 | ok( $p, 'new customized parser' ); |
34 | |
35 | foreach my $key ( keys %customize ) { |
36 | is( $p->$key(), $customize{$key}, "customized $key" ); |
37 | } |
38 | |
39 | # TODO: make sure these things are propogated down through the parser... |