Hello community, here is the log from the commit of package perl-Moo for openSUSE:Factory checked in at 2014-11-14 09:18:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Moo (Old) and /work/SRC/openSUSE:Factory/.perl-Moo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Moo" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Moo/perl-Moo.changes 2014-09-18 08:02:17.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Moo.new/perl-Moo.changes 2014-11-14 09:19:00.000000000 +0100 @@ -1,0 +2,15 @@ +Wed Nov 12 09:37:28 UTC 2014 - co...@suse.com + +- updated to 1.006001 + - Name the ->DOES method installed by Role::Tiny + - don't apply threading workarounds on non-threaded perls, even if module for + it is loaded by something + - avoid loading base.pm and just set @ISA manually + - fix some Pod links to Class::Method::Modifiers + - fix applying roles with multiple attributes with defaults to objects + (RT#99217) + - fix Moose inheriting from a Moo class that inherits from a non-M* class + when the Moose class is not made immutable + - fix ->does method on Moose child classes of Moo classes + +------------------------------------------------------------------- Old: ---- Moo-1.006000.tar.gz New: ---- Moo-1.006001.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Moo.spec ++++++ --- /var/tmp/diff_new_pack.VoeSsD/_old 2014-11-14 09:19:01.000000000 +0100 +++ /var/tmp/diff_new_pack.VoeSsD/_new 2014-11-14 09:19:01.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-Moo -Version: 1.006000 +Version: 1.006001 Release: 0 %define cpan_name Moo Summary: Minimalist Object Orientation (with Moose compatibility) @@ -33,7 +33,7 @@ BuildRequires: perl(Devel::GlobalDestruction) >= 0.11 BuildRequires: perl(Import::Into) >= 1.002 BuildRequires: perl(Module::Runtime) >= 0.014 -BuildRequires: perl(Role::Tiny) >= 1.003003 +BuildRequires: perl(Role::Tiny) >= 1.003004 BuildRequires: perl(Test::Fatal) >= 0.003 BuildRequires: perl(Test::More) >= 0.94 BuildRequires: perl(strictures) >= 1.004003 @@ -41,7 +41,7 @@ Requires: perl(Devel::GlobalDestruction) >= 0.11 Requires: perl(Import::Into) >= 1.002 Requires: perl(Module::Runtime) >= 0.014 -Requires: perl(Role::Tiny) >= 1.003003 +Requires: perl(Role::Tiny) >= 1.003004 Requires: perl(strictures) >= 1.004003 Recommends: perl(Class::XSAccessor) >= 1.18 Recommends: perl(Sub::Name) ++++++ Moo-1.006000.tar.gz -> Moo-1.006001.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/Changes new/Moo-1.006001/Changes --- old/Moo-1.006000/Changes 2014-08-16 18:21:32.000000000 +0200 +++ new/Moo-1.006001/Changes 2014-10-22 18:20:00.000000000 +0200 @@ -1,5 +1,17 @@ Revision history for Moo +1.006001 - 2014-10-22 + - Name the ->DOES method installed by Role::Tiny + - don't apply threading workarounds on non-threaded perls, even if module for + it is loaded by something + - avoid loading base.pm and just set @ISA manually + - fix some Pod links to Class::Method::Modifiers + - fix applying roles with multiple attributes with defaults to objects + (RT#99217) + - fix Moose inheriting from a Moo class that inherits from a non-M* class + when the Moose class is not made immutable + - fix ->does method on Moose child classes of Moo classes + 1.006000 - 2014-08-16 - support coerce => 1 in attributes, taking the coercion from the isa option if it is an object that supports the coerce or coercion method. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/META.json new/Moo-1.006001/META.json --- old/Moo-1.006000/META.json 2014-08-16 18:21:46.000000000 +0200 +++ new/Moo-1.006001/META.json 2014-10-22 18:20:21.000000000 +0200 @@ -4,7 +4,7 @@ "mst - Matt S. Trout (cpan:MSTROUT) <m...@shadowcat.co.uk>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520", + "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142690", "license" : [ "perl_5" ], @@ -49,9 +49,10 @@ "requires" : { "Class::Method::Modifiers" : "1.1", "Devel::GlobalDestruction" : "0.11", + "Exporter" : "5.57", "Import::Into" : "1.002", "Module::Runtime" : "0.014", - "Role::Tiny" : "1.003003", + "Role::Tiny" : "1.003004", "Scalar::Util" : "0", "perl" : "5.006", "strictures" : "1.004003" @@ -83,7 +84,7 @@ }, "x_IRC" : "irc://irc.perl.org/#moose" }, - "version" : "1.006000", + "version" : "1.006001", "x_authority" : "cpan:MSTROUT", "x_breaks" : { "HTML::Restrict" : "== 2.1.5" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/META.yml new/Moo-1.006001/META.yml --- old/Moo-1.006000/META.yml 2014-08-16 18:21:45.000000000 +0200 +++ new/Moo-1.006001/META.yml 2014-10-22 18:20:20.000000000 +0200 @@ -8,7 +8,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520' +generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142690' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -24,9 +24,10 @@ requires: Class::Method::Modifiers: '1.1' Devel::GlobalDestruction: '0.11' + Exporter: '5.57' Import::Into: '1.002' Module::Runtime: '0.014' - Role::Tiny: '1.003003' + Role::Tiny: '1.003004' Scalar::Util: '0' perl: '5.006' strictures: '1.004003' @@ -35,7 +36,7 @@ bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Moo license: http://dev.perl.org/licenses/ repository: https://github.com/moose/Moo.git -version: '1.006000' +version: '1.006001' x_authority: cpan:MSTROUT x_breaks: HTML::Restrict: '== 2.1.5' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/Makefile.PL new/Moo-1.006001/Makefile.PL --- old/Moo-1.006000/Makefile.PL 2014-08-16 14:44:12.000000000 +0200 +++ new/Moo-1.006001/Makefile.PL 2014-10-22 18:06:15.000000000 +0200 @@ -25,11 +25,12 @@ 'Class::Method::Modifiers' => 1.10, # for RT#80194 'strictures' => 1.004003, 'Module::Runtime' => 0.014, # for RT#86394 - 'Role::Tiny' => 1.003003, + 'Role::Tiny' => 1.003004, 'Devel::GlobalDestruction' => 0.11, # for RT#78617 'Import::Into' => 1.002, 'Scalar::Util' => 0, 'perl' => 5.006, + 'Exporter' => 5.57, # Import 'import' }, recommends => { 'Class::XSAccessor' => 1.18, @@ -75,7 +76,7 @@ realclean => { FILES => 'Distar/' }, ); -############################################################################## +## BOILERPLATE ############################################################### require ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; @@ -86,8 +87,10 @@ ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g; ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g; -$MM_ARGS{LICENSE} = $META{license} - if $eumm_version >= 6.30; +$META{license} = [ $META{license} ] + if $META{license} && !ref $META{license}; +$MM_ARGS{LICENSE} = $META{license}[0] + if $META{license} && $eumm_version >= 6.30; $MM_ARGS{NO_MYMETA} = 1 if $mymeta_broken; $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META } @@ -114,3 +117,4 @@ if $eumm_version < 6.51_03; ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS); +## END BOILERPLATE ########################################################### diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/README new/Moo-1.006001/README --- old/Moo-1.006000/README 2014-08-16 18:21:46.000000000 +0200 +++ new/Moo-1.006001/README 2014-10-22 18:20:21.000000000 +0200 @@ -469,19 +469,19 @@ before before foo => sub { ... }; - See "before method(s) => sub { ... }" in Class::Method::Modifiers for + See "before method(s) => sub { ... };" in Class::Method::Modifiers for full documentation. around around foo => sub { ... }; - See "around method(s) => sub { ... }" in Class::Method::Modifiers for + See "around method(s) => sub { ... };" in Class::Method::Modifiers for full documentation. after after foo => sub { ... }; - See "after method(s) => sub { ... }" in Class::Method::Modifiers for + See "after method(s) => sub { ... };" in Class::Method::Modifiers for full documentation. SUB QUOTE AWARE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Method/Generate/Accessor.pm new/Moo-1.006001/lib/Method/Generate/Accessor.pm --- old/Moo-1.006000/lib/Method/Generate/Accessor.pm 2014-08-08 14:25:59.000000000 +0200 +++ new/Moo-1.006001/lib/Method/Generate/Accessor.pm 2014-10-18 18:37:59.000000000 +0200 @@ -2,7 +2,8 @@ use strictures 1; use Moo::_Utils; -use base qw(Moo::Object); +use Moo::Object (); +our @ISA = qw(Moo::Object); use Sub::Quote qw(quote_sub quoted_from_sub quotify); use Scalar::Util 'blessed'; use overload (); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Method/Generate/BuildAll.pm new/Moo-1.006001/lib/Method/Generate/BuildAll.pm --- old/Moo-1.006000/lib/Method/Generate/BuildAll.pm 2014-08-08 15:22:45.000000000 +0200 +++ new/Moo-1.006001/lib/Method/Generate/BuildAll.pm 2014-10-20 18:49:57.000000000 +0200 @@ -1,7 +1,8 @@ package Method::Generate::BuildAll; use strictures 1; -use base qw(Moo::Object); +use Moo::Object (); +our @ISA = qw(Moo::Object); use Sub::Quote qw(quote_sub quotify); use Moo::_Utils; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Method/Generate/DemolishAll.pm new/Moo-1.006001/lib/Method/Generate/DemolishAll.pm --- old/Moo-1.006000/lib/Method/Generate/DemolishAll.pm 2014-08-03 11:54:59.000000000 +0200 +++ new/Moo-1.006001/lib/Method/Generate/DemolishAll.pm 2014-10-18 18:08:58.000000000 +0200 @@ -1,7 +1,8 @@ package Method::Generate::DemolishAll; use strictures 1; -use base qw(Moo::Object); +use Moo::Object (); +our @ISA = qw(Moo::Object); use Sub::Quote qw(quote_sub quotify); use Moo::_Utils; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Moo/HandleMoose/_TypeMap.pm new/Moo-1.006001/lib/Moo/HandleMoose/_TypeMap.pm --- old/Moo-1.006000/lib/Moo/HandleMoose/_TypeMap.pm 2014-08-03 11:54:59.000000000 +0200 +++ new/Moo-1.006001/lib/Moo/HandleMoose/_TypeMap.pm 2014-10-18 18:08:58.000000000 +0200 @@ -8,6 +8,7 @@ package Moo::HandleMoose::_TypeMap; use Scalar::Util (); +use Config; our %WEAK_TYPES; @@ -65,8 +66,10 @@ %TYPE_MAP = %types; } -my @types = %TYPE_MAP; -tie %TYPE_MAP, __PACKAGE__; -%TYPE_MAP = @types; +if ($Config{useithreads}) { + my @types = %TYPE_MAP; + tie %TYPE_MAP, __PACKAGE__; + %TYPE_MAP = @types; +} 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Moo/Role.pm new/Moo-1.006001/lib/Moo/Role.pm --- old/Moo-1.006000/lib/Moo/Role.pm 2014-08-16 17:52:17.000000000 +0200 +++ new/Moo-1.006001/lib/Moo/Role.pm 2014-10-22 18:19:40.000000000 +0200 @@ -3,10 +3,10 @@ use strictures 1; use Moo::_Utils; use Role::Tiny (); -use base qw(Role::Tiny); +our @ISA = qw(Role::Tiny); use Import::Into; -our $VERSION = '1.006000'; +our $VERSION = '1.006001'; $VERSION = eval $VERSION; require Moo::sification; @@ -323,7 +323,7 @@ my $specs = $con_gen->all_attribute_specs; - my $assign = ''; + my $assign = "{no warnings 'void';\n"; my %captures; foreach my $name ( keys %attrs ) { my $spec = $specs->{$name}; @@ -333,11 +333,12 @@ my ($code, $pop_cap) = $m->generate_use_default('$_[0]', $name, $spec, $has); - $assign .= $code; + $assign .= $code . ";\n"; @captures{keys %$has_cap, keys %$pop_cap} = (values %$has_cap, values %$pop_cap); } } + $assign .= "}"; Sub::Quote::quote_sub($assign, \%captures); } else { @@ -361,6 +362,28 @@ _install_modifier(@args); } +sub _install_does { + my ($me, $to) = @_; + + # If Role::Tiny actually installed the DOES, give it a name + my $new = $me->SUPER::_install_does($to) or return; + return _name_coderef("${to}::DOES", $new); +} + +sub does_role { + my ($proto, $role) = @_; + return 1 + if Role::Tiny::does_role($proto, $role); + my $meta; + if ($INC{'Moose.pm'} + and $meta = Class::MOP::class_of($proto) + and ref $meta ne 'Moo::HandleMoose::FakeMetaClass' + ) { + return $meta->does_role($role); + } + return 0; +} + sub _handle_constructor { my ($me, $to, $role) = @_; my $attr_info = $INFO{$role} && $INFO{$role}{attributes}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Moo/_Utils.pm new/Moo-1.006001/lib/Moo/_Utils.pm --- old/Moo-1.006000/lib/Moo/_Utils.pm 2014-08-03 11:54:59.000000000 +0200 +++ new/Moo-1.006001/lib/Moo/_Utils.pm 2014-10-18 18:08:58.000000000 +0200 @@ -12,7 +12,7 @@ use Module::Runtime qw(use_package_optimistically module_notional_filename); use Devel::GlobalDestruction (); -use base qw(Exporter); +use Exporter qw(import); use Moo::_mro; use Config; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Moo.pm new/Moo-1.006001/lib/Moo.pm --- old/Moo-1.006000/lib/Moo.pm 2014-08-16 17:52:17.000000000 +0200 +++ new/Moo-1.006001/lib/Moo.pm 2014-10-22 18:19:40.000000000 +0200 @@ -4,7 +4,7 @@ use Moo::_Utils; use Import::Into; -our $VERSION = '1.006000'; +our $VERSION = '1.006001'; $VERSION = eval $VERSION; require Moo::sification; @@ -190,7 +190,10 @@ .' '.$class.'->_constructor_maker_for($class);'."\n" .' return $class->new(@_)'.";\n" .' } elsif ($INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)) {'."\n" - .' return $meta->new_object($class->BUILDARGS(@_));'."\n" + .' return $meta->new_object('."\n" + .' $class->can("BUILDARGS") ? $class->BUILDARGS(@_)'."\n" + .' : $class->Moo::Object::BUILDARGS(@_)'."\n" + .' );'."\n" .' }'."\n" ), ) @@ -711,21 +714,21 @@ before foo => sub { ... }; -See L<< Class::Method::Modifiers/before method(s) => sub { ... } >> for full +See L<< Class::Method::Modifiers/before method(s) => sub { ... }; >> for full documentation. =head2 around around foo => sub { ... }; -See L<< Class::Method::Modifiers/around method(s) => sub { ... } >> for full +See L<< Class::Method::Modifiers/around method(s) => sub { ... }; >> for full documentation. =head2 after after foo => sub { ... }; -See L<< Class::Method::Modifiers/after method(s) => sub { ... } >> for full +See L<< Class::Method::Modifiers/after method(s) => sub { ... }; >> for full documentation. =head1 SUB QUOTE AWARE @@ -929,13 +932,13 @@ Users' IRC: #moose on irc.perl.org -=for html <a href="http://chat.mibbit.com/#mo...@irc.perl.org">(click for -instant chatroom login)</a> +=for :html +L<(click for instance chatroom login)|http://chat.mibbit.com/#mo...@irc.perl.org> Development and contribution IRC: #web-simple on irc.perl.org -=for html <a href="http://chat.mibbit.com/#web-sim...@irc.perl.org">(click for -instant chatroom login)</a> +=for :html +L<(click for instance chatroom login)|http://chat.mibbit.com/#web-sim...@irc.perl.org> Bugtracker: L<https://rt.cpan.org/Public/Dist/Display.html?Name=Moo> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Sub/Defer.pm new/Moo-1.006001/lib/Sub/Defer.pm --- old/Moo-1.006000/lib/Sub/Defer.pm 2014-08-16 17:52:17.000000000 +0200 +++ new/Moo-1.006001/lib/Sub/Defer.pm 2014-10-22 18:19:40.000000000 +0200 @@ -1,11 +1,11 @@ package Sub::Defer; use strictures 1; -use base qw(Exporter); +use Exporter qw(import); use Moo::_Utils; use Scalar::Util qw(weaken); -our $VERSION = '1.006000'; +our $VERSION = '1.006001'; $VERSION = eval $VERSION; our @EXPORT = qw(defer_sub undefer_sub undefer_all); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/lib/Sub/Quote.pm new/Moo-1.006001/lib/Sub/Quote.pm --- old/Moo-1.006000/lib/Sub/Quote.pm 2014-08-16 17:52:17.000000000 +0200 +++ new/Moo-1.006001/lib/Sub/Quote.pm 2014-10-22 18:19:40.000000000 +0200 @@ -6,13 +6,13 @@ use Sub::Defer; use Scalar::Util qw(weaken); -use base qw(Exporter); +use Exporter qw(import); use B (); BEGIN { *_HAVE_PERLSTRING = defined &B::perlstring ? sub(){1} : sub(){0}; } -our $VERSION = '1.006000'; +our $VERSION = '1.006001'; $VERSION = eval $VERSION; our @EXPORT = qw(quote_sub unquote_sub quoted_from_sub qsub); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/t/compose-roles.t new/Moo-1.006001/t/compose-roles.t --- old/Moo-1.006000/t/compose-roles.t 2013-12-08 16:36:08.000000000 +0100 +++ new/Moo-1.006001/t/compose-roles.t 2014-10-18 18:10:03.000000000 +0200 @@ -114,5 +114,25 @@ }, qr/Can't apply .* missing attr2/, 'create_class_with_roles accepts attributes for requirements'; +{ + package RoleWith2Attrs; + use Moo::Role; + + has attr1 => (is => 'ro', default => -1); + has attr2 => (is => 'ro', default => -2); +} + +foreach my $combo ( + [qw(RoleWithAttr RoleWithAttr2)], + [qw(RoleWith2Attrs)], +) { + is exception { + my $o = Moo::Role->apply_roles_to_object( + EmptyClass->new, @$combo); + is($o->attr1, -1, 'first attribute works'); + is($o->attr2, -2, 'second attribute works'); + }, undef, "apply_roles_to_object with multiple attrs with defaults (@$combo)"; +} + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/t/sub-and-handles.t new/Moo-1.006001/t/sub-and-handles.t --- old/Moo-1.006000/t/sub-and-handles.t 2013-12-08 16:36:08.000000000 +0100 +++ new/Moo-1.006001/t/sub-and-handles.t 2014-10-18 18:10:03.000000000 +0200 @@ -34,7 +34,7 @@ sub _bar { 'extended' } - package A; + package First; use Moo; extends 'ConsumesDelegateToBar'; @@ -42,7 +42,7 @@ has '+_barrer' => ( is => 'rw' ); - package B; + package Second; use Moo; extends 'ConsumesDelegateToBar'; @@ -51,7 +51,7 @@ has '+_barrer' => ( is => 'rw' ); - package D; + package Fourth; use Moo; extends 'ConsumesDelegateToBar'; @@ -62,7 +62,7 @@ is => 'rw', handles => { _baz => 'bar' }, ); - package C; + package Third; use Moo; extends 'ConsumesDelegateToBar'; @@ -74,12 +74,12 @@ ); } -is(A->new->_bar, 'extended', 'overriding delegate method with role works'); -is(D->new->_bar, 'extended', '... even when you specify other delegates in subclass'); -is(D->new->_baz, 'unextended!', '... and said other delegate still works'); -is(B->new->_bar, 'extended', 'overriding delegate method directly works'); -is(C->new->_bar, 'extended', '... even when you specify other delegates in subclass'); -is(C->new->_baz, 'unextended!', '... and said other delegate still works'); +is(First->new->_bar, 'extended', 'overriding delegate method with role works'); +is(Fourth->new->_bar, 'extended', '... even when you specify other delegates in subclass'); +is(Fourth->new->_baz, 'unextended!', '... and said other delegate still works'); +is(Second->new->_bar, 'extended', 'overriding delegate method directly works'); +is(Third->new->_bar, 'extended', '... even when you specify other delegates in subclass'); +is(Third->new->_baz, 'unextended!', '... and said other delegate still works'); done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/xt/moose-extend-moo.t new/Moo-1.006001/xt/moose-extend-moo.t --- old/Moo-1.006000/xt/moose-extend-moo.t 2014-06-21 13:04:52.000000000 +0200 +++ new/Moo-1.006001/xt/moose-extend-moo.t 2014-10-22 18:06:15.000000000 +0200 @@ -1,36 +1,85 @@ use strict; use warnings; +use Test::More; +use Test::Fatal; +BEGIN { + package Parent; + use Moo; + has message => ( is => 'ro', required => 1 ), +} -{ - package Parent; - use Moo; - has message => ( is => 'ro', required => 1 ), -} - -{ - package Child; - use Moose; - extends 'Parent'; - use Moose::Util::TypeConstraints; - use namespace::clean; # <-- essential - has message => ( - is => 'ro', isa => 'Str', - lazy => 1, - default => sub { 'overridden message sub here' }, - ); +BEGIN { + package Child; + use Moose; + extends 'Parent'; + use Moose::Util::TypeConstraints; + use namespace::clean; # <-- essential + has message => ( + is => 'ro', isa => 'Str', + lazy => 1, + default => sub { 'overridden message sub here' }, + ); } +# without namespace::clean, gives the (non-fatal) warning: +# You are overwriting a locally defined function (message) with an accessor +# ...because Moose::Util::TypeConstraints exports a 'message' sub! my $obj = Child->new(message => 'custom message'); -use Test::More; is($obj->message, 'custom message', 'accessor works'); -done_testing; +BEGIN { + package Role1; + use Moo::Role; +} -__END__ +BEGIN { + package Role2; + use Moose::Role; +} + +BEGIN { + package Class1; + use Moo; + with 'Role1'; +} -without namespace::clean, gives the (non-fatal) warning: -You are overwriting a locally defined function (message) with an accessor +BEGIN { + package Class2; + use Moose; + extends 'Class1'; + with 'Role2'; +} -...because Moose::Util::TypeConstraints exports a 'message' sub! +ok +Class2->does('Role1'), "Moose child does parent's composed roles"; +ok +Class2->does('Role2'), "Moose child does child's composed roles"; + +BEGIN { + package NonMooParent; + sub new { + bless {}, $_[0]; + } +} +BEGIN { + package MooChild; + use Moo; + extends 'NonMooParent'; + has attr1 => (is => 'ro'); + with 'Role1'; +} +BEGIN { + package MooseChild; + use Moose; + extends 'MooChild'; + with 'Role2'; + has attr2 => (is => 'ro'); +} + +is exception { MooseChild->new }, undef, 'NonMoo->Moo->Moose(mutable) works'; +MooseChild->meta->make_immutable; +is exception { MooseChild->new }, undef, 'NonMoo->Moo->Moose(immutable) works'; + +ok +MooseChild->does('Role2'), "Moose child does parent's composed roles with non-Moo ancestor"; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Moo-1.006000/xt/test-my-dependents.t new/Moo-1.006001/xt/test-my-dependents.t --- old/Moo-1.006000/xt/test-my-dependents.t 2014-06-21 13:06:30.000000000 +0200 +++ new/Moo-1.006001/xt/test-my-dependents.t 2014-10-18 18:10:03.000000000 +0200 @@ -19,7 +19,8 @@ } use Test::DependentModules qw( test_module ); -use MetaCPAN::API; +use JSON::PP; +use HTTP::Tiny; use List::Util (); use Cwd (); use Config; @@ -35,9 +36,9 @@ # avoid any modules that depend on these my @bad_prereqs = qw(Gtk2 Padre Wx); -my $mcpan = MetaCPAN::API->new; -my $res = $mcpan->post( - '/search/reverse_dependencies/Moo' => { +my $res = decode_json(HTTP::Tiny->new->post( + 'http://api.metacpan.org/v0/search/reverse_dependencies/Moo', + { content => encode_json({ query => { filtered => { query => { "match_all" => {} }, @@ -56,8 +57,8 @@ }, size => 5000, fields => ['distribution', 'provides', 'metadata.provides'], - }, -); + }) }, +)->{content}); my %bad_dist; my $sec_reason; @@ -145,8 +146,6 @@ plan tests => scalar @modules; for my $module (@modules) { - local $TODO = $todo_module{$module} || '???' - if exists $todo_module{$module}; SKIP: { local $TODO = $todo_module{$module} || '???' if exists $todo_module{$module}; @@ -156,7 +155,6 @@ } } - __DATA__ # TODO: broken -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org