Re: There is something about namespaces!

2010-06-16 Thread Jesse Luehrs
On Wed, Jun 16, 2010 at 03:11:34PM -0700, Kate Yoak wrote: > > (Unrelated, but indirect method calls are evil! Stop that!) > > > Indirect method calls? Whatever do you mean? > my $one = new Foo::Child; This should be my $one = Foo::Child->new; See http://www.shadowcat.co.uk/blog/matt-s-tr

Re: There is something about namespaces!

2010-06-16 Thread Kate Yoak
> > 'extends' happens at runtime, so when your test stuff is running, the > 'extends' call hasn't happened yet. 'use' and 'package' are compile > time, so those parts *are* set up before the test stuff starts running. > Either move the packages up before the tests, or wrap the packages in a > BEGI

Re: There is something about namespaces!

2010-06-16 Thread Jesse Luehrs
On Wed, Jun 16, 2010 at 03:02:23PM -0700, Kate Yoak wrote: > When I define my packages right inside a script (like for testing), Moose > inheritance breaks down: > > #!/usr/bin/perl > > use strict; > use Test::More tests => 2; > > my $one = new Foo::Child; > ok($one->can('foo'), "extends"); #fa

There is something about namespaces!

2010-06-16 Thread Kate Yoak
When I define my packages right inside a script (like for testing), Moose inheritance breaks down: #!/usr/bin/perl use strict; use Test::More tests => 2; my $one = new Foo::Child; ok($one->can('foo'), "extends"); #fails my $two = new Foo::App; ok($two->can('foo'), "isa"); #succeeds package Fo