Commits

Anonymous committed f155448

Added another output-limiting class. Modified some of the tests to use it.

Comments (0)

Files changed (2)

SVN/RaWeb/Light/Test/LimitOutput.pm

 
 1;
 
+package SVN::RaWeb::Light::OutputTransAndList;
+
+use base 'SVN::RaWeb::Light';
+
+sub process_dir
+{
+    my $self = shift;
+    $self->get_dir();
+
+    print $self->render_top_url_translations_text();
+    $self->print_items_list();
+}
+
+1;
+
 }
 
 # Test the directory output for a regular (non-root) directory.
-# TODO: check with url_translations.
-# TODO: check for file output with a defualt mime type of text/plain.
 {
     local @CGI::new_params = ('path_info' => "/trunk/mydir/");
 
     reset_out_buffer();
 
     my $svn_ra_web =
-        SVN::RaWeb::Light->new(
+        SVN::RaWeb::Light::OutputTransAndList->new(
             'url' => "http://svn-i.shlomifish.org/svn/myrepos/",
             'url_translations' =>
             [
 
     # TEST
     is_deeply([split(/\n/, $results)], [(split /\n/, <<"EOF")]
-Content-Type: text/html
-
-<html><head><title>Revision 10900: /trunk/mydir</title></head>
-<body>
-<h2>Revision 10900: /trunk/mydir</h2>
 <table border=\"1\">
 <tr><td><a href=\"svn://svn.myhost.mytld/hello/there/trunk/mydir/\">Read-Only</a></td></tr>
 <tr><td><a href=\"svn+ssh://svnwrite.myhost.mytld/root/myroot/trunk/mydir/\">Write</a></td></tr>
 <li><a href=\"hello.pm\">hello.pm</a> [<a href="svn://svn.myhost.mytld/hello/there/trunk/mydir/hello.pm">Read-Only</a>] [<a href="svn+ssh://svnwrite.myhost.mytld/root/myroot/trunk/mydir/hello.pm">Write</a>]</li>
 <li><a href=\"mydir/\">mydir/</a> [<a href="svn://svn.myhost.mytld/hello/there/trunk/mydir/mydir/">Read-Only</a>] [<a href="svn+ssh://svnwrite.myhost.mytld/root/myroot/trunk/mydir/mydir/">Write</a>]</li>
 </ul>
-</body></html>
 EOF
     , "Check for url_translations of a regular (non-root) directory.");        
 }
     reset_out_buffer();
 
     my $svn_ra_web =
-        SVN::RaWeb::Light->new(
+        SVN::RaWeb::Light::OutputTransAndList->new(
             'url' => "http://svn-i.shlomifish.org/svn/myrepos/",
             'url_translations' =>
             [
 
     # TEST
     is_deeply([split(/\n/, $results)], [(split /\n/, <<"EOF")]
-Content-Type: text/html
-
-<html><head><title>Revision 10900: /trunk/mydir</title></head>
-<body>
-<h2>Revision 10900: /trunk/mydir</h2>
 <table border=\"1\">
 <tr><td><a href=\"svn://svn.myhost.mytld/hello/there/trunk/mydir/\">Read-Only</a></td></tr>
 <tr><td><a href=\"svn+ssh://svnwrite.myhost.mytld/root/myroot/trunk/mydir/\">Write</a></td></tr>
 <li><a href=\"hello.pm?trans_no_list=1\">hello.pm</a></li>
 <li><a href=\"mydir/?trans_no_list=1\">mydir/</a></li>
 </ul>
-</body></html>
 EOF
     , "Checking for trans_no_list=1");
 }