[libmoox-late-perl] 02/06: this is broken - arrays of attributes
Intrigeri
intrigeri at moszumanska.debian.org
Thu Aug 14 11:13:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to tag 0.005
in repository libmoox-late-perl.
commit c9ae36631ed42559b4c5a9910edfab5a34a58f4d
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date: Sun Dec 9 21:29:05 2012 +0000
this is broken - arrays of attributes
---
t/04arrayofattrs.t | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/t/04arrayofattrs.t b/t/04arrayofattrs.t
new file mode 100644
index 0000000..2048582
--- /dev/null
+++ b/t/04arrayofattrs.t
@@ -0,0 +1,30 @@
+use strict;
+use warnings;
+use Test::More;
+
+{
+ package Local::Role;
+ use Moo::Role;
+ use MooX::late;
+ has [qw(foo1 foo2)] => (is => 'ro', isa => 'Str', lazy_build => 1);
+ sub _build_foo1 { 'foo1' };
+ sub _build_foo2 { 'foo2' };
+}
+
+{
+ package Local::Class;
+ use Moo;
+ use MooX::late;
+ with 'Local::Role';
+ has [qw(bar1 bar2)] => (is => 'ro', isa => 'Str', lazy_build => 1);
+ sub _build_bar1 { 'bar1' };
+ sub _build_bar2 { 'bar2' };
+}
+
+my $o1 = Local::Class->new;
+is($o1->foo1, 'foo1');
+is($o1->foo2, 'foo2');
+is($o1->bar1, 'bar1');
+is($o1->bar2, 'bar2');
+
+done_testing;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoox-late-perl.git
More information about the Pkg-perl-cvs-commits
mailing list