X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=t%2F4_app_00_base.t;h=ef636489f31cc7cced25451be44ecaa4ebd3ee10;hp=5d86acaeaa245e2e14bb367572c93cc6e3e54095;hb=6ab8b2e8e8388d1a238148a1ee58e124855f3768;hpb=fdecaac30a1168ed894c46d61b6c95524ec62a4e diff --git a/t/4_app_00_base.t b/t/4_app_00_base.t index 5d86aca..ef63648 100644 --- a/t/4_app_00_base.t +++ b/t/4_app_00_base.t @@ -16,13 +16,31 @@ we do try to put it through most paces. use Test::More tests => 234; use strict; use warnings; -use CGI::Ex::Dump qw(debug); +use CGI::Ex::Dump qw(debug caller_trace); +{ + package CGIXFail; + use vars qw($AUTOLOAD); + sub new { bless {}, __PACKAGE__ } + sub DESTROY {} + sub AUTOLOAD { + my $self = shift; + my $meth = ($AUTOLOAD =~ /::(\w+$)/) ? $1 : die "Invalid method $AUTOLOAD"; + die "Not calling CGI::Ex method $meth while testing App"; + } +} { package Foo; use base qw(CGI::Ex::App); use vars qw($test_stdout); + use CGI::Ex::Dump qw(debug caller_trace); + + sub cgix { shift->{'cgix'} ||= CGIXFail->new } # for our tests try not to access external + + sub form { shift->{'form'} ||= {} } + + sub cookies { shift->{'cookies'} ||= {} } sub init { $test_stdout = '' } @@ -693,7 +711,7 @@ foreach my $type (qw(base if $type ne 'form'; my $meth2 = "add_to_$type"; - my $c = CGI::Ex::App->new; + my $c = CGI::Ex::App->new({cgix => CGI::Ex->new({form=>{}})}); $c->$meth2({bing => 'bang'}); $c->$meth2(bong => 'beng');