UPDATE: maybe solved. Thanks to everyone for the help.

Having chosen Door Number 3, it seems at least some of it is easier than I'd feared. This, for example, seems to work, except for the last test:

use strict; use warnings; use Test::More tests => 5; use CGI; use Test::MockObject; use Apache2::Cookie 2.08; # This gets me started. my $r = Test::MockObject->new(); $r->mock( pool => sub { return APR::Pool->new; } ); # This part looks good. my $c = Apache2::Cookie->new( $r, # mocked -name => 'mycookie', -value => 'whatever' ) or die "no cookie for you"; isa_ok( $c, 'Apache2::Cookie' ); is( $c->value, 'whatever', "value" ); # This works for some values, but doing random # stuff via chr() can break it. I need to write # more tests to figure out whether that's my fault. my $val = "über die Straße"; my $c2 = Apache2::Cookie->new( $r, # mocked -name => 'mycookie', -value => $val ) or die "no cookie for you"; like( $c2->as_string, qr/[a-zA-Z0-9%=]+/, "as_string encoded" ); is( $c2->value, $val, "value not encoded" ); # Uh-oh, this is busted. I think I can live # without it, but it's annoying. eval { $c2->raw_value(); }; is( $@, '', "raw_value() doesn't die" );

That last test gets me this error:

Can't locate auto/Apache2/Cookie/raw_value.al in @INC

Joy. If it's just a case of the docs being wrong, yet the code working, then I'm OK with that. I can file a documentation bug, with a test and a patch, if I can prove it.

I'm sure I have the right version installed, and as I built it from source I'm also sure all its non-skipped tests.


In reply to Re: Where can I buy an $r with which to test Apache2::Cookie? by frostman
in thread Where can I buy an $r with which to test Apache2::Cookie? by frostman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.