X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_utils_prefix.t;fp=t%2Faggregate%2Funit_utils_prefix.t;h=506fbc21ae17d30c1b7fa485eb817935d7c2c4f7;hb=5d50f369bffa3625ca983b72fc8bc013c8a1e802;hp=0000000000000000000000000000000000000000;hpb=a2aac3b8867dea286d03eba07a6fbe2e237cf1ae;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_utils_prefix.t b/t/aggregate/unit_utils_prefix.t new file mode 100644 index 0000000..506fbc2 --- /dev/null +++ b/t/aggregate/unit_utils_prefix.t @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 8; + +use lib "t/lib"; + +use Catalyst::Utils; + +is( Catalyst::Utils::class2prefix('MyApp::V::Foo::Bar'), 'foo/bar', 'class2prefix works with M/V/C' ); + +is( Catalyst::Utils::class2prefix('MyApp::Controller::Foo::Bar'), 'foo/bar', 'class2prefix works with Model/View/Controller' ); + +is( Catalyst::Utils::class2prefix('MyApp::Controller::Foo::View::Bar'), 'foo/view/bar', 'class2prefix works with tricky components' ); + +is( Catalyst::Utils::appprefix('MyApp::Foo'), 'myapp_foo', 'appprefix works' ); + +is( Catalyst::Utils::class2appclass('MyApp::Foo::Controller::Bar::View::Baz'), 'MyApp::Foo', 'class2appclass works' ); + +is( Catalyst::Utils::class2classprefix('MyApp::Foo::Controller::Bar::View::Baz'), 'MyApp::Foo::Controller', 'class2classprefix works' ); + +is( Catalyst::Utils::class2classsuffix('MyApp::Foo::Controller::Bar::View::Baz'), 'Controller::Bar::View::Baz', 'class2classsuffix works' ); + +is( Catalyst::Utils::class2env('MyApp::Foo'), 'MYAPP_FOO', 'class2env works' );