summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/20-aseag.t21
-rw-r--r--t/21-get-stop-by-name.t11
-rw-r--r--t/22-results-via.t22
-rw-r--r--t/in/instant_V1 (renamed from t/in/aseag_20131223T132300)0
4 files changed, 26 insertions, 28 deletions
diff --git a/t/20-aseag.t b/t/20-aseag.t
index 2d96037..84bb6e2 100644
--- a/t/20-aseag.t
+++ b/t/20-aseag.t
@@ -5,17 +5,17 @@ use 5.010;
use utf8;
use Encode qw(decode);
-use File::Slurp qw(slurp);
use List::Util qw(first);
-use Test::More tests => 14;
+use Test::More tests => 13;
BEGIN {
- use_ok('Travel::Status::DE::ASEAG');
+ use_ok('Travel::Status::DE::URA');
}
-require_ok('Travel::Status::DE::ASEAG');
+require_ok('Travel::Status::DE::URA');
-my $rawstr = slurp('t/in/aseag_20131223T132300');
-my $s = Travel::Status::DE::ASEAG->new_from_raw(
+my $s = Travel::Status::DE::URA->new(
+ ura_base => 'file:t/in',
+ ura_version => 1,
datetime => DateTime->new(
year => 2014,
month => 1,
@@ -24,12 +24,10 @@ my $s = Travel::Status::DE::ASEAG->new_from_raw(
minute => 1,
time_zone => 'Europe/Berlin'
),
- raw_str => $rawstr,
hide_past => 0
);
-isa_ok( 'Travel::Status::DE::ASEAG', 'Travel::Status::DE::URA' );
-isa_ok( $s, 'Travel::Status::DE::ASEAG' );
+isa_ok( $s, 'Travel::Status::DE::URA' );
can_ok( $s, qw(errstr results) );
@@ -67,7 +65,9 @@ is( ( first { $_->stop ne 'Aachen Bushof' } @results ),
undef, '"Aachen Bushof" only matches "Aachen Bushof"' );
# exact matching: also works in constructor
-$s = Travel::Status::DE::ASEAG->new_from_raw(
+$s = Travel::Status::DE::URA->new(
+ ura_base => 'file:t/in',
+ ura_version => 1,
datetime => DateTime->new(
year => 2014,
month => 1,
@@ -76,7 +76,6 @@ $s = Travel::Status::DE::ASEAG->new_from_raw(
minute => 1,
time_zone => 'Europe/Berlin'
),
- raw_str => $rawstr,
hide_past => 0,
stop => 'Aachen Bushof',
);
diff --git a/t/21-get-stop-by-name.t b/t/21-get-stop-by-name.t
index 43952ac..48cd3a7 100644
--- a/t/21-get-stop-by-name.t
+++ b/t/21-get-stop-by-name.t
@@ -5,18 +5,17 @@ use 5.010;
use utf8;
use Encode qw(decode);
-use File::Slurp qw(slurp);
use List::Util qw(first);
use Test::More tests => 5;
BEGIN {
- use_ok('Travel::Status::DE::ASEAG');
+ use_ok('Travel::Status::DE::URA');
}
-require_ok('Travel::Status::DE::ASEAG');
+require_ok('Travel::Status::DE::URA');
-my $rawstr = slurp('t/in/aseag_20131223T132300');
-my $s = Travel::Status::DE::ASEAG->new_from_raw(
- raw_str => $rawstr,
+my $s = Travel::Status::DE::URA->new(
+ ura_base => 'file:t/in',
+ ura_version => 1,
hide_past => 0
);
diff --git a/t/22-results-via.t b/t/22-results-via.t
index 7bda954..ac8d7eb 100644
--- a/t/22-results-via.t
+++ b/t/22-results-via.t
@@ -4,22 +4,21 @@ use warnings;
use 5.010;
use utf8;
-use Encode qw(decode);
-use File::Slurp qw(slurp);
use List::Util qw(first);
use Test::More tests => 23;
BEGIN {
- use_ok('Travel::Status::DE::ASEAG');
+ use_ok('Travel::Status::DE::URA');
}
-require_ok('Travel::Status::DE::ASEAG');
+require_ok('Travel::Status::DE::URA');
-my $rawstr = slurp('t/in/aseag_20131223T132300');
my ($s, @results);
# via filter in ->results, implicit route_after
-$s = Travel::Status::DE::ASEAG->new_from_raw(
+$s = Travel::Status::DE::URA->new(
+ ura_base => 'file:t/in',
+ ura_version => 1,
datetime => DateTime->new(
year => 2013,
month => 12,
@@ -28,7 +27,6 @@ $s = Travel::Status::DE::ASEAG->new_from_raw(
minute => 0,
time_zone => 'Europe/Berlin'
),
- raw_str => $rawstr,
hide_past => 0,
stop => 'Aachen Bushof',
);
@@ -63,8 +61,9 @@ is(
# via filter in ->results, explicit route_after
-$s = Travel::Status::DE::ASEAG->new_from_raw(
- raw_str => $rawstr,
+$s = Travel::Status::DE::URA->new(
+ ura_base => 'file:t/in',
+ ura_version => 1,
hide_past => 0,
stop => 'Aachen Bushof',
);
@@ -102,8 +101,9 @@ is(
# via filter in ->results, explicit route_before
-$s = Travel::Status::DE::ASEAG->new_from_raw(
- raw_str => $rawstr,
+$s = Travel::Status::DE::URA->new(
+ ura_base => 'file:t/in',
+ ura_version => 1,
hide_past => 0,
stop => 'Aachen Bushof',
);
diff --git a/t/in/aseag_20131223T132300 b/t/in/instant_V1
index 7b99f4b..7b99f4b 100644
--- a/t/in/aseag_20131223T132300
+++ b/t/in/instant_V1