summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-07 22:01:30 -0500
committerdoy <doy@tozt.net>2009-04-07 22:01:30 -0500
commit749b2945c77a0ecca584e60a0ea48bb97062c9f2 (patch)
treee56957f3b6a26446d21f69a074a67856fa857e3c /t
parent72dce79a74ebcca5f6c74ed1b6204cdf06931fbe (diff)
downloadmoosex-nonmoose-749b2945c77a0ecca584e60a0ea48bb97062c9f2.tar.gz
moosex-nonmoose-749b2945c77a0ecca584e60a0ea48bb97062c9f2.zip
a few basic tests
Diffstat (limited to 't')
-rw-r--r--t/000-load.t7
-rw-r--r--t/001-basic.t24
2 files changed, 31 insertions, 0 deletions
diff --git a/t/000-load.t b/t/000-load.t
new file mode 100644
index 0000000..0a6968e
--- /dev/null
+++ b/t/000-load.t
@@ -0,0 +1,7 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+package Foo;
+::use_ok 'MooseX::NonMoose';
diff --git a/t/001-basic.t b/t/001-basic.t
new file mode 100644
index 0000000..1a060af
--- /dev/null
+++ b/t/001-basic.t
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+package Foo;
+
+sub new {
+ my $class = shift;
+ bless { _class => $class }, $class;
+}
+
+package Foo::Moose;
+use Moose;
+use MooseX::NonMoose;
+extends_nonmoose 'Foo';
+
+package main;
+my $foo = Foo->new;
+my $foo_moose = Foo::Moose->new;
+isa_ok $foo, 'Foo';
+is $foo->{_class}, 'Foo', 'Foo gets the correct class';
+isa_ok $foo_moose, 'Foo::Moose';
+is $foo_moose->{_class}, 'Foo::Moose', 'Foo::Moose gets the correct class';