include test for failure mode
[catagits/Catalyst-Runtime.git] / t / unit_core_path_to.t
index c675739..a89135c 100644 (file)
@@ -2,7 +2,6 @@ use strict;
 use warnings;
 
 use Test::More;
-use Test::MockObject;
 
 my %non_unix = (
     MacOS   => 1,
@@ -18,21 +17,23 @@ my %non_unix = (
 my $os = $non_unix{$^O} ? $^O : 'Unix';
 
 if(  $os ne 'Unix' ) {
-       plan skip_all => 'tests require Unix';
+    plan skip_all => 'tests require Unix';
 }
 else {
-       plan tests => 3;
+    plan tests => 3;
 }
 
-my $context = Test::MockObject->new;
-
 use_ok('Catalyst');
 
-$context->mock( 'config', sub { { home => '/home/sri/my-app/' } } );
+my $context = 'Catalyst';
+
+my $config = Catalyst->config;
+
+$config->{home} = '/home/sri/my-app/';
 
 is( Catalyst::path_to( $context, 'foo' ), '/home/sri/my-app/foo', 'Unix path' );
 
-$context->mock( 'config', sub { { home => '/Users/sri/myapp' } } );
+$config->{home} = '/Users/sri/myapp/';
 
 is( Catalyst::path_to( $context, 'foo', 'bar' ),
     '/Users/sri/myapp/foo/bar', 'deep Unix path' );