1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/usr/bin/perl
use strict;
use warnings;
use Test::Fatal;
use Test::More;
use Test::Warnings;
use HTTP::Headers::ActionPack;
use HTTP::Headers::ActionPack::AuthenticationInfo;
{
my $auth = HTTP::Headers::ActionPack::AuthenticationInfo->new(
foo => 42,
bar => undef,
);
isa_ok(
$auth, 'HTTP::Headers::ActionPack::AuthenticationInfo',
'object from constructor'
);
is( $auth->as_string, q{foo="42", bar=""}, 'auth header as string' );
}
{
my $auth = HTTP::Headers::ActionPack->new->create_header(
'Authentication-Info',
q{foo="42", bar=},
);
isa_ok(
$auth, 'HTTP::Headers::ActionPack::AuthenticationInfo',
'object from $pack->create_header'
);
is( $auth->as_string, q{foo="42", bar=""}, 'auth header as string' );
}
done_testing();
|