Make Moose components collaberate with non-Moose Catalyst
[catagits/Catalyst-Runtime.git] / t / live_component_controller_moose.t
index e0b6f5d..98912ba 100644 (file)
@@ -1,18 +1,23 @@
-#!perl
-
 use strict;
 use warnings;
+use Test::More;
+
+BEGIN {
+    if (eval 'require Moose; 1') {
+        plan tests => 2;
+    }
+    else {
+        plan skip_all => 'Moose is required for this test';
+    }
+}
 
 use FindBin;
 use lib "$FindBin::Bin/lib";
 
-our $iters;
-
-use Test::More tests => 2;
 use Catalyst::Test 'TestApp';
 
 {
-    my $response = request('http://localhost/moose/get_attribute');
+    my $response = request('http://localhost/moose/the_answer');
     ok($response->is_success);
-    is($response->content, '42', 'attribute default values get set correctly');
+    is($response->content, 'the meaning of life: 42', 'attr defaults + BUILD works correctly');
 }