Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest
In directory sc8-pr-cvs1:/tmp/cvs-serv15939
Modified Files:
Recorder.pm
Log Message:
Add is_recording() method to disable/enable recording
Index: Recorder.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Recorder.pm 15 Jan 2003 21:15:58 -0000 1.2
--- Recorder.pm 18 Jan 2003 17:03:59 -0000 1.3
***************
*** 49,52 ****
--- 49,54 ----
# stores all test cases
*tests = make_access_method('TESTS', sub { [] });
+ # if recording is enabled
+ *is_recording = make_access_method('IS_RECORDING', sub { 0 });
# serve web interface and do recording/proxying
***************
*** 65,72 ****
# proxy request
my $response = $self->user_agent->simple_request($request);
! my $test = HTTP::WebTest::Test->new;
! $test->request($request);
! $test->response($response);
! push @{$self->tests}, $test;
return $response;
}
--- 67,76 ----
# proxy request
my $response = $self->user_agent->simple_request($request);
! if($self->is_recording) {
! my $test = HTTP::WebTest::Test->new;
! $test->request($request);
! $test->response($response);
! push @{$self->tests}, $test;
! }
return $response;
}
|