[libmoosex-semiaffordanceaccessor-perl] 01/10: More tests to make sure that if a reader or writer is explicitly set, we don't mess with the method names
Intrigeri
intrigeri at moszumanska.debian.org
Thu Aug 28 15:44:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to annotated tag 0.04
in repository libmoosex-semiaffordanceaccessor-perl.
commit 5f9f886db7092f25f877863adda9cf3ae29d9eee
Author: Dave Rolsky <autarch at urth.org>
Date: Tue Dec 16 20:23:26 2008 +0000
More tests to make sure that if a reader or writer is explicitly set, we don't mess with the method names
---
t/basic.t | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/t/basic.t b/t/basic.t
index 8aa8dcd..3df6729 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More tests => 12;
+use Test::More tests => 19;
{
@@ -34,6 +34,17 @@ use Test::More tests => 12;
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' );
@@ -49,3 +60,11 @@ ok( SAA2->can('thing'), 'SAA2->thing() exists' );
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' );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-semiaffordanceaccessor-perl.git
More information about the Pkg-perl-cvs-commits
mailing list