Implement and test --check-spool. Make Mock/UserAgent save put and post data in an array. Make Percona/WebAPI/Client accept ready-made text resources, for multi-part resources.

This commit is contained in:
Daniel Nichter
2013-01-08 18:49:42 -07:00
parent d68301f293
commit 526437632c
6 changed files with 435 additions and 108 deletions

View File

@@ -31,8 +31,8 @@ sub new {
put => [],
},
content => {
post => undef,
put => undef,
post => [],
put => [],
},
};
return bless $self, $class;
@@ -42,7 +42,7 @@ sub request {
my ($self, $req) = @_;
my $type = lc($req->method);
if ( $type eq 'post' || $type eq 'put' ) {
$self->{content}->{$type} = $req->content;
push @{$self->{content}->{$type}}, $req->content;
}
my $r = shift @{$self->{responses}->{$type}};
my $c = $self->{encode}->($r->{content});