herveus has asked for the wisdom of the Perl Monks concerning the following question:
I'm building a class hierarchy using Object::InsideOut. Here's the problem package:
Here's the test:package Morsulus::Catalog::SetOf; use strict; use warnings; use Object::InsideOut qw/ Set::Scalar::Valued /; { my @the_sets :Field :Get('_get_the_set'); sub _init :Init { my $self = shift; my $args = shift; my $the_set = Set::Scalar::Valued->new(); $self->set(\@the_sets, $the_set); $self->inherit($the_set, $args); } } 1;
Here's the relevant output of the script:use Test::More tests => 4; use Test::Exception; BEGIN { use_ok( 'Morsulus::Catalog::SetOf' ); } diag( "Testing Morsulus::Catalog::SetOf"); my $thingy; lives_ok { $thingy = Morsulus::Catalog::SetOf->new(); } 'created SetOf +'; ok $thingy->can('values'), '$thingy->can("values")'; ok $thingy->isa('Set::Scalar::Valued'), '$thingy is a Set::Scalar::Val +ued';
I tried writing my _init subroutine using the POD as guidance, but that failed the same way. I could not discern anything constructive by examining the code. I don't know if this is a bug in Object::InsideOut or something simple I'm just missing. Can anyone help me figure out what is going wrong here?t/00.setof....NOK 2/4 + # Failed test 'created SetOf' # at t/00.setof.t line 12. # died: OIO::Args error: Missing arg(s) to '->inherit()' # Package: Morsulus::Catalog::SetOf # File: blib/lib/Morsulus/Catalog/SetOf.pm # Line: 17 # # # Trace begun at blib/lib/Morsulus/Catalog/SetOf.pm line 17 # Object::InsideOut::new at t/00.setof.t line 12 # Test::Exception::lives_ok at t/00.setof.t line 12
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Difficulty with Object::InsideOut
by Anno (Deacon) on Mar 24, 2007 at 12:14 UTC | |
by herveus (Prior) on Mar 24, 2007 at 17:44 UTC | |
by Anno (Deacon) on Mar 25, 2007 at 01:52 UTC | |
by herveus (Prior) on Mar 25, 2007 at 16:20 UTC | |
by Anno (Deacon) on Mar 25, 2007 at 20:52 UTC | |
|
Re: Difficulty with Object::InsideOut
by herveus (Prior) on Mar 24, 2007 at 22:15 UTC | |
|
Re: Difficulty with Object::InsideOut
by herveus (Prior) on Mar 25, 2007 at 17:21 UTC |