summaryrefslogtreecommitdiff
path: root/t/21-vrr-ambig.t
diff options
context:
space:
mode:
Diffstat (limited to 't/21-vrr-ambig.t')
-rw-r--r--t/21-vrr-ambig.t35
1 files changed, 22 insertions, 13 deletions
diff --git a/t/21-vrr-ambig.t b/t/21-vrr-ambig.t
index e4783f5..a201d52 100644
--- a/t/21-vrr-ambig.t
+++ b/t/21-vrr-ambig.t
@@ -5,27 +5,36 @@ use 5.010;
use utf8;
use File::Slurp qw(slurp);
-use Test::More tests => 10;
+use JSON;
+use Test::More tests => 9;
BEGIN {
use_ok('Travel::Status::DE::VRR');
}
require_ok('Travel::Status::DE::VRR');
-my $xml = slurp('t/in/essen_alfredusbad_ambiguous.xml');
+my $json
+ = JSON->new->utf8->decode( scalar slurp('t/in/essen_alfred_ambiguous.json') );
-my $status = Travel::Status::DE::VRR->new_from_xml(xml => $xml);
+my $status = Travel::Status::DE::VRR->new( from_json => $json );
-isa_ok($status, 'Travel::Status::DE::VRR');
-can_ok($status, qw(errstr results));
+isa_ok( $status, 'Travel::Status::DE::VRR' );
+can_ok( $status, qw(errstr results) );
$status->check_for_ambiguous();
-is($status->errstr, 'ambiguous name parameter', 'errstr ok');
-
-is_deeply([$status->place_candidates], [], 'place candidates ok');
-is_deeply([$status->name_candidates], ['Alfredusbad', 'Am Alfredusbad'], 'name candidates ok');
-
-is_deeply([$status->lines], [], 'no lines');
-is_deeply([$status->results], [], 'no results');
-is_deeply([$status->identified_data], [qw[Essen Alfredusbad]], 'identified data');
+is( $status->errstr, 'ambiguous name parameter', 'errstr ok' );
+
+is_deeply( [ $status->place_candidates ], [], 'place candidates ok' );
+is_deeply(
+ [ $status->name_candidates ],
+ [
+ 'Essen, Alfred-Krupp-Schule',
+ 'Essen, Alfredbrücke',
+ 'Essen, Alfredusbad'
+ ],
+ 'name candidates ok'
+);
+
+is_deeply( [ $status->lines ], [], 'no lines' );
+is_deeply( [ $status->results ], [], 'no results' );