Fix component_setup + tests
[catagits/Catalyst-Runtime.git] / t / unit_core_component_layers.t
diff --git a/t/unit_core_component_layers.t b/t/unit_core_component_layers.t
new file mode 100644 (file)
index 0000000..4261365
--- /dev/null
@@ -0,0 +1,21 @@
+use Test::More tests => 5;
+use strict;
+use warnings;
+use lib 't/lib';
+
+# This tests that we actually load the physical
+#  copy of Model::Foo::Bar, in the case that Model::Foo
+#  defines the Model::Foo::Bar namespace in memory,
+#  but does not load the corresponding file.
+
+use_ok 'TestApp';
+
+my $model_foo     = TestApp->model('Foo');
+
+can_ok($model_foo, 'model_foo_method');
+can_ok($model_foo, 'bar');
+
+my $model_foo_bar = $model_foo->bar;
+
+can_ok($model_foo_bar, 'model_foo_bar_method_from_foo');
+can_ok($model_foo_bar, 'model_foo_bar_method_from_foo_bar');