summaryrefslogtreecommitdiff
path: root/t/21-vrr-ambig.t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-11-20 12:42:44 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-11-20 12:42:44 +0100
commitd146e44ff3a8b3304e6603a2238c40034c4b91a1 (patch)
tree8e34dd730d76d273e36f782bff218d1e8aec2f42 /t/21-vrr-ambig.t
parenta32aaf5392f222c120e00eb556897d435993c8e2 (diff)
VRR.pm: Check for 'ambiguous input' error condition
Diffstat (limited to 't/21-vrr-ambig.t')
-rw-r--r--t/21-vrr-ambig.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/21-vrr-ambig.t b/t/21-vrr-ambig.t
new file mode 100644
index 0000000..7dd96a4
--- /dev/null
+++ b/t/21-vrr-ambig.t
@@ -0,0 +1,28 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use 5.010;
+use utf8;
+
+use File::Slurp qw(slurp);
+use Test::More tests => 7;
+
+BEGIN {
+ use_ok('Travel::Status::DE::VRR');
+}
+require_ok('Travel::Status::DE::VRR');
+
+my $xml = slurp('t/in/essen_alfredusbad_ambiguous.xml');
+
+my $status = Travel::Status::DE::VRR->new_from_xml(xml => $xml);
+
+isa_ok($status, 'Travel::Status::DE::VRR');
+can_ok($status, qw(errstr results));
+
+$status->check_for_ambiguous();
+
+is($status->errstr, 'Ambiguous name input: Alfredusbad | Am Alfredusbad',
+ 'errstr ok');
+
+is_deeply([$status->lines], [], 'no lines');
+is_deeply([$status->results], [], 'no results');