X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Fclass_traits.t;h=d6a0c5052871cf6563d1c4423a9bb02c459748e9;hp=2f6e4f36f1fd8d3147ce2de12251cea732e5834a;hb=cea573d8055680f12b061aa8adcf0b54f576bb7b;hpb=2d4da72cfbed7e0130b483f3ec0530b4f29e267c diff --git a/t/class_traits.t b/t/class_traits.t index 2f6e4f3..d6a0c50 100644 --- a/t/class_traits.t +++ b/t/class_traits.t @@ -4,6 +4,17 @@ use Test::More; use Class::MOP; BEGIN { + my %hidden = map { (my $m = "$_.pm") =~ s{::}{/}g; $m => 1 } qw( + Foo + Bar + ); + unshift @INC, sub { + return unless exists $hidden{$_[1]}; + die "Can't locate $_[1] in \@INC (hidden)\n"; + }; +} + +BEGIN { package TestRole; $INC{'TestRole'} = __FILE__; use Moose::Role; @@ -18,7 +29,7 @@ BEGIN { sub c { 'c' } package TestApp::TraitFor::Request::Bar; - $INC{'Catalyst/TraitFor/Request/Bar.pm'} = __FILE__; + $INC{'TestApp/TraitFor/Request/Bar.pm'} = __FILE__; use Moose::Role; sub d { 'd' } @@ -30,8 +41,8 @@ BEGIN { sub c { 'c' } - package TestApp::TraitFor::Response::Bar; - $INC{'Catalyst/TraitFor/Response/Bar.pm'} = __FILE__; + package TestApp::TraitFor::Response::Bar; + $INC{'TestApp/TraitFor/Response/Bar.pm'} = __FILE__; use Moose::Role;