Mercurial > hg > nginx-tests
comparison _common.pm @ 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 | a58a62e9d695 |
children |
comparison
equal
deleted
inserted
replaced
11:f6bb0ffdb9b4 | 12:d19146b30334 |
---|---|
9 use warnings; | 9 use warnings; |
10 use strict; | 10 use strict; |
11 | 11 |
12 use base qw/ Exporter /; | 12 use base qw/ Exporter /; |
13 | 13 |
14 our @EXPORT = qw/ start_nginx smtp_connect smtp_send smtp_read smtp_check | 14 our @EXPORT = qw/ start_nginx write_file smtp_connect smtp_send smtp_read |
15 smtp_ok log_in log_out http /; | 15 smtp_check smtp_ok log_in log_out http /; |
16 | 16 |
17 ############################################################################### | 17 ############################################################################### |
18 | 18 |
19 use Test::More; | 19 use Test::More; |
20 use File::Temp qw/ tempdir /; | 20 use File::Temp qw/ tempdir /; |
59 wait; | 59 wait; |
60 } | 60 } |
61 | 61 |
62 END { | 62 END { |
63 stop_nginx(); | 63 stop_nginx(); |
64 } | |
65 | |
66 sub write_file { | |
67 my ($name, $content) = @_; | |
68 | |
69 open F, '>' . $testdir . '/' . $name | |
70 or die "Can't create $name: $!"; | |
71 print F $content; | |
72 close F; | |
64 } | 73 } |
65 | 74 |
66 ############################################################################### | 75 ############################################################################### |
67 | 76 |
68 sub log_out { | 77 sub log_out { |