summaryrefslogtreecommitdiffstats
path: root/t/moose/moose_cookbook_extending_recipe2.t
diff options
context:
space:
mode:
Diffstat (limited to 't/moose/moose_cookbook_extending_recipe2.t')
-rw-r--r--t/moose/moose_cookbook_extending_recipe2.t65
1 files changed, 65 insertions, 0 deletions
diff --git a/t/moose/moose_cookbook_extending_recipe2.t b/t/moose/moose_cookbook_extending_recipe2.t
new file mode 100644
index 0000000..763586e
--- /dev/null
+++ b/t/moose/moose_cookbook_extending_recipe2.t
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More 'no_plan';
+use Test::Exception;
+$| = 1;
+
+
+
+# =begin testing SETUP
+BEGIN {
+ eval 'use Test::Output;';
+ if ($@) {
+ diag 'Test::Output is required for this test';
+ ok(1);
+ exit 0;
+ }
+}
+
+
+
+# =begin testing SETUP
+{
+
+ package MooseX::Debugging;
+
+ use MooseX::Exporter::Easy;
+
+ base_class_roles 'MooseX::Debugging::Role::Object';
+
+ export;
+
+ package MooseX::Debugging::Role::Object;
+
+ use Moose::Role;
+
+ after 'BUILDALL' => sub {
+ my $self = shift;
+
+ warn "Made a new " . ( ref $self ) . " object\n";
+ };
+}
+
+
+
+# =begin testing
+{
+{
+ package Debugged;
+
+ use Moose;
+ MooseX::Debugging->import;
+}
+
+stderr_is(
+ sub { Debugged->new },
+ "Made a new Debugged object\n",
+ 'got expected output from debugging role'
+);
+}
+
+
+
+
+1;