[Moose-commits] r7106 - MooseX-SemiAffordanceAccessor/trunk/t

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Tue Dec 16 20:23:26 GMT 2008


Author: autarch
Date: 2008-12-16 12:23:26 -0800 (Tue, 16 Dec 2008)
New Revision: 7106

Modified:
   MooseX-SemiAffordanceAccessor/trunk/t/basic.t
Log:
More tests to make sure that if a reader or writer is explicitly set, we don't mess with the method names


Modified: MooseX-SemiAffordanceAccessor/trunk/t/basic.t
===================================================================
--- MooseX-SemiAffordanceAccessor/trunk/t/basic.t	2008-12-16 20:13:25 UTC (rev 7105)
+++ MooseX-SemiAffordanceAccessor/trunk/t/basic.t	2008-12-16 20:23:26 UTC (rev 7106)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More tests => 19;
 
 
 {
@@ -34,7 +34,18 @@
     has '_private' => ( is => 'rw' );
 }
 
+{
+    package SAA3;
 
+    use Moose;
+    use MooseX::SemiAffordanceAccessor;
+
+    has 'ro' => ( is => 'ro' );
+    has 'thing' => ( is => 'rw', reader => 'get_thing' );
+    has 'thing2' => ( is => 'rw', writer => 'set_it' );
+}
+
+
 ok( Standard->can('thing'), 'Standard->thing() exists' );
 ok( ! Standard->can('set_thing'), 'Standard->set_thing() does not exist' );
 ok( Standard->can('_private'), 'Standard->_private() exists' );
@@ -49,3 +60,11 @@
 ok( SAA2->can('set_thing'), 'SAA2->set_thing() exists' );
 ok( SAA2->can('_private'), 'SAA2->_private() exists' );
 ok( SAA2->can('_set_private'), 'SAA2->_set_private() exists' );
+
+ok( SAA3->can('ro'), 'SAA3->ro exists' );
+ok( ! SAA3->can('set_ro'), 'SAA3->set_ro does not exist' );
+ok( SAA3->can('thing'), 'SAA3->thing exists' );
+ok( ! SAA3->can('set_thing'), 'SAA3->set_thing does not exist' );
+ok( SAA3->can('thing2'), 'SAA3->thing2 exists' );
+ok( ! SAA3->can('set_thing2'), 'SAA3->set_thing2 does not exist' );
+ok( SAA3->can('set_it'), 'SAA3->set_it does exist' );




More information about the Moose-commits mailing list