diff options
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | lib/Config/HAProxy.pm | 3 | ||||
-rw-r--r-- | t/format.t | 17 | ||||
-rw-r--r-- | t/select.t | 1 |
4 files changed, 10 insertions, 15 deletions
@@ -1,4 +1,8 @@ Revision history for Perl extension Config::HAProxy. +1.01 Thu Jul 12 09:04:28 2018 + - set minimal required Perl version + - drop dependency on autodie + 1.00 Sun Jul 8 19:57:57 2018 - original revision diff --git a/lib/Config/HAProxy.pm b/lib/Config/HAProxy.pm index 74eafa4..9a8d666 100644 --- a/lib/Config/HAProxy.pm +++ b/lib/Config/HAProxy.pm @@ -372,5 +372,6 @@ Saves the parse tree in the configuration file. $cfg->write($file, %hash); -Writes configuration to the named file or file handle. If B<$file> is the +Writes configuration to the named file or file handle. First argument +can be a file name, file handle or a string reference. If it is the only argument, the original indentation is preserved. Otherwise, if B<%hash> controls the indentation of the output. It must contain at least @@ -4,5 +4,4 @@ use strict; use warnings; use Test::More; -use autodie; BEGIN { @@ -15,7 +14,5 @@ isa_ok($hp,'Test::HAProxy'); my $s; -open(my $fh, '>', \$s); -$hp->write($fh); -close $fh; +$hp->write(\$s); is($s, q{global @@ -34,7 +31,5 @@ backend out }, 'default write'); -open($fh, '>', \$s); -$hp->write($fh, indent => 2); -close $fh; +$hp->write(\$s, indent => 2); is($s, q{global @@ -53,7 +48,5 @@ backend out }, 'reindent'); -open($fh, '>', \$s); -$hp->write($fh, indent => 2, reindent_comments => 1); -close $fh; +$hp->write(\$s, indent => 2, reindent_comments => 1); is($s, q{global @@ -72,7 +65,5 @@ backend out }, 'reindent comments'); -open($fh, '>', \$s); -$hp->write($fh, indent => 4, tabstop => [ 10, 24 ]); -close $fh; +$hp->write(\$s, indent => 4, tabstop => [ 10, 24 ]); is($s, q{global @@ -4,5 +4,4 @@ use strict; use warnings; use Test::More; -use autodie; BEGIN { |