# HG changeset patch # User Maxim Dounin # Date 1221148504 -14400 # Node ID d19146b303347e40b0bed6645f35fc26857fed2c # Parent f6bb0ffdb9b4a4712e4b2e24fadd4f632dc16174 Tests: move write_file() into _common.pm. diff --git a/_common.pm b/_common.pm --- 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 { diff --git a/ssi-include-big.t b/ssi-include-big.t --- 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; -} - ###############################################################################