소스 검색

Add documentation about the updated test harness class

Daniel Gempesaw 11 년 전
부모
커밋
d38671659d
1개의 변경된 파일16개의 추가작업 그리고 4개의 파일을 삭제
  1. 16 4
      t/lib/TestHarness.pm

+ 16 - 4
t/lib/TestHarness.pm

@@ -8,11 +8,23 @@ use Test::More;
 
 =head1 SYNOPSIS
 
-    my $harness = TestHarness->new(
+    my %selenium_args = %{ TestHarness->new(
         this_file => $FindBin::Script
-    );
-    my %selenium_args = %{ $harness->base_caps };
-    $harness->skip_all_unless_mocks_exist;
+    )->base_caps };
+
+=head1 DESCRIPTION
+
+A setup class for all the repetitive things we need to do before
+running tests. First, we're deciding whether the test is in C<record>
+or C<replay> mode. If we're recording, we'll end up writing all the
+HTTP request/response pairs out to L</mock_file>. If we're replaying,
+we'll look for our OS-appropriate mock_file and try to read from it.
+
+After we figure that out, we can instantiate our
+Mock::RemoteConnection with the proper constructor arguments and
+return that as our base_args for use in the tests! Finally, on
+destruction, if we're recording, we make sure to dump out all of the
+request/response pairs to the mock_file.
 
 =attr this_file