This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id:
133407
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
perl [...] toby.ink
Cc:
AdminCc:

BugTracker
Severity:
Unimportant
Broken in:
(no value)
Fixed in:
(no value)



Subject: Inconsistent handling of Foo::Bar, ::Foo::Bar, and main::Foo::Bar
The following all basically work the same in Perl: my $obj = 'Foo::Bar'->new; my $obj = '::Foo::Bar'->new; my $obj = 'main::Foo::Bar'->new; Using any of those class names in $obj->isa works fine. Other bits, like $obj->DOES seem inconsistent with Moo. (But Moo does better than Moose!)
Subject: package-name-test-moo.t
use strict; use warnings; use Test::More; { package GGG; use Moo::Role; } { package Goose; use Moo; with 'GGG'; has 'goo' => ( is => 'ro' ); } my @roles = qw( GGG ::GGG main::GGG ); my @classes = qw( Goose ::Goose main::Goose ); foreach my $class ( @classes ) { subtest "\$class = '$class'" => sub { my $obj = $class->new( 'goo' => 42 ); is( $obj->goo, 42, '$obj->goo == 42' ); isa_ok( $obj, $_, '$obj' ) for @classes; ok( $obj->DOES($_), "\$obj\->DOES($_)" ) for @roles; ok( $obj->does($_), "\$obj\->does($_)" ) for @roles; }; } done_testing;


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.