Caleb,
So I think you are misunderstanding how parameterized containers work.
You are not capturing the output of ->create in this line:
$sc->create( conf => $conf );
The result of ->create is the container with the parameters applied, it does not do an in-place parameterization.
Which explains why this line:
is( $c->resolve( service => 'tsubc/test' ), 'foo', 'service is foo' );
fails to do what you expect.
Basically you should be replacing those two lines with the following:
my $p = $sc->create( conf => $conf );
is( $p->resolve( service => 'test' ), 'foo', 'service is foo' );
after which your tests all pass.
- Stevan
On Apr 17, 2012, at 5:18 PM, Caleb Cushing via RT wrote:
Show quoted text> Tue Apr 17 17:18:07 2012: Request 76642 was acted upon.
> Transaction: Ticket created by XENO
> Queue: Bread-Board
> Subject: parameterized issues
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: xenoterracide@gmail.com
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=76642 >
>
>
> I may have lied a little about the errors earlier (or gotten different
> errors while working through the issue )? or am finding others while
> writing the test... this test fails, but I think it should pass.
>
> 'parameterized-sugar' fails, but seems to be what one should be doing.
> I have also written a couple of similar tests that use
> ->add_sub_container without being a parameterized class that seem to
> work fine.
>
> --
> Caleb Cushing
>
>
http://xenoterracide.com
>
> <0001-test-for-using-parameterized-sugar.patch>