The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More tests => 2;

BEGIN {
  package MyApp::Controller::Foo;

  use base qw/Catalyst::Controller/;

  package MyApp::Controller::Root;

  use base qw/Catalyst::Controller/;

  __PACKAGE__->config(namespace => '');

  package Stub;

  sub config { {} };
}

is(MyApp::Controller::Foo->action_namespace('Stub'), 'foo');

is(MyApp::Controller::Root->action_namespace('Stub'), '');