changeset 12:d19146b30334

Tests: move write_file() into _common.pm.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Sep 2008 19:55:04 +0400
parents f6bb0ffdb9b4
children e8edb765595d
files _common.pm ssi-include-big.t
diffstat 2 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/_common.pm
+++ b/_common.pm
@@ -11,8 +11,8 @@ use strict;
 
 use base qw/ Exporter /;
 
-our @EXPORT = qw/ start_nginx smtp_connect smtp_send smtp_read smtp_check
-	smtp_ok log_in log_out http /;
+our @EXPORT = qw/ start_nginx write_file smtp_connect smtp_send smtp_read
+	smtp_check smtp_ok log_in log_out http /;
 
 ###############################################################################
 
@@ -63,6 +63,15 @@ END {
 	stop_nginx();
 }
 
+sub write_file {
+	my ($name, $content) = @_;
+
+	open F, '>' . $testdir . '/' . $name
+		or die "Can't create $name: $!";
+	print F $content;
+	close F;
+}
+
 ###############################################################################
 
 sub log_out {
--- a/ssi-include-big.t
+++ b/ssi-include-big.t
@@ -56,13 +56,4 @@ Accept-Encoding: gzip
 EOF
 }
 
-sub write_file {
-	my ($name, $content) = @_;
-
-	open F, '>' . $_common::testdir . '/' . $name
-		or die "Can't create $name: $!";
-	print F $content;
-	close F;
-}
-
 ###############################################################################