summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-01-22 11:53:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-01-22 11:53:01 +0100
commit8d952e1b3a40d59d95e827aee419b3bf79194cb9 (patch)
tree4a14be14a716bb94068749ee43712ee5ef7f1143 /lib/Travel/Status
parentf0fba026a14cbee4af4d033244237d257aeaa15c (diff)
use predefined datetime for tests
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/URA.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm
index 71981c6..5e25074 100644
--- a/lib/Travel/Status/DE/URA.pm
+++ b/lib/Travel/Status/DE/URA.pm
@@ -25,6 +25,8 @@ sub new {
}
my $self = {
+ datetime => $opt{datetime}
+ // DateTime->now( time_zone => 'Europe/Berlin' ),
ura_base => $opt{ura_base},
ura_version => $opt{ura_version},
full_routes => $opt{full_routes} // 0,
@@ -63,6 +65,8 @@ sub new_from_raw {
my ( $class, %opt ) = @_;
my $self = {
+ datetime => $opt{datetime}
+ // DateTime->now( time_zone => 'Europe/Berlin' ),
ura_base => $opt{ura_base},
ura_version => $opt{ura_version},
full_routes => $opt{full_routes} // 0,
@@ -127,7 +131,7 @@ sub results {
my $stop = $opt{stop} // $self->{stop};
my $via = $opt{via} // $self->{via};
- my $dt_now = DateTime->now( time_zone => 'Europe/Berlin' );
+ my $dt_now = $self->{datetime};
my $ts_now = $dt_now->epoch;
if ($via) {