Subject: | Add test for failure to provide a filename to write() |
A piece of low-hanging fruit left over from previous coverage-boosting patch. Attached.
Subject: | 0001-Test-failure-to-provide-filename-to-write.patch |
From 2e99c44f812300b2142dd59d6f9cad99499f9fd8 Mon Sep 17 00:00:00 2001
From: jkeenan <jkeenan@cpan.org>
Date: Sat, 12 Oct 2013 18:40:38 -0400
Subject: [PATCH] Test failure to provide filename to write().
---
t/24_misc.t | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/t/24_misc.t b/t/24_misc.t
index ff210f1..9aa4861 100644
--- a/t/24_misc.t
+++ b/t/24_misc.t
@@ -9,7 +9,7 @@ BEGIN {
use File::Spec::Functions ':ALL';
use t::lib::Test;
-use Test::More qw(no_plan); # tests => 24;;
+use Test::More tests => 20;;
use YAML::Tiny;
use File::Temp qw(tempfile);
@@ -22,6 +22,9 @@ use File::Temp qw(tempfile);
eval { $yaml = $obj->read($file); };
ok(! YAML::Tiny->errstr, "\$obj->read: No error, as expected");
isa_ok( $yaml, 'YAML::Tiny' );
+ eval { $yaml->write(); };
+ like( YAML::Tiny->errstr, qr/No file name provided/,
+ "No filename provided to write()");
$YAML::Tiny::errstr = '';
}
--
1.6.3.2