Permalink
Browse files

move tests into Foo.pm

  • Loading branch information...
1 parent 6529e04 commit 5ffd7f8ac4af5a11bd2b991a8080ef4f58c0bc9b Matt S Trout committed Jan 4, 2009
Showing with 11 additions and 9 deletions.
  1. +10 −0 t/lib/Foo.pm
  2. +1 −9 t/simple-mop.t
View
@@ -9,4 +9,14 @@ $meta->add_attribute('one',
$meta->make_immutable;
+$::tests{do { __PACKAGE__ }} = sub {
+ ::ok(my $foo = Foo->new(one => 1), "created object");
+
+ ::is($foo->get_one, 1, "got one");
+
+ ::is($foo->set_one(2), 2, "got two");
+
+ ::is($foo->get_one, 2, "still two");
+};
+
$meta;
View
@@ -17,15 +17,7 @@ sub setup_class {
}
sub verify_class {
-
- ok(my $foo = Foo->new(one => 1), "created object");
-
- is($foo->get_one, 1, "got one");
-
- is($foo->set_one(2), 2, "got two");
-
- is($foo->get_one, 2, "still two");
-
+ $::tests{Foo}->();
}
my $foo_class = setup_class;

0 comments on commit 5ffd7f8

Please sign in to comment.