Tests: move write_file() into _common.pm.
diff --git a/_common.pm b/_common.pm
index ffbbbe2..30752bd 100644
--- a/_common.pm
+++ b/_common.pm
@@ -11,8 +11,8 @@
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 @@
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 {