Permalink
Browse files

Weird hacks in 02.array.t to make it pass when DateTime is not installed

  • Loading branch information...
1 parent 8d40b85 commit 9a294f344606e4e3ca23b88527a375599247c5ec @mstratman committed Apr 12, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 t/02.array.t
View
15 t/02.array.t
@@ -1,20 +1,23 @@
use Test::More;
use lib 't/lib';
use DateTime::Format::Human::Duration;
-use DateTime;
use FindBin qw($Bin);
use File::Spec;
BEGIN { push @INC, File::Spec->catfile($Bin, 'lib'); }
-my $dta = DateTime->now( locale => 'nb' );
-my $dtb = $dta->clone->add( minutes => 1 );
-my $dtc = $dta->clone->subtract( minutes => 1 );
-
-
my $fmt = DateTime::Format::Human::Duration->new;
+ok(1, "placeholder");
TODO: {
+ # Hrm... can you skip in a TODO?
+ eval 'use DateTime';
+ last TODO if $@;
+
+ my $dta = DateTime->now( locale => 'nb' );
+ my $dtb = $dta->clone->add( minutes => 1 );
+ my $dtc = $dta->clone->subtract( minutes => 1 );
+
local $TODO = "See outstanding RT issue #74923: https://rt.cpan.org/Public/Bug/Display.html?id=74923";
is($fmt->format_duration_between($dta, $dtb, past => '%s ago', future => 'in %s'),
'in 1mi');

0 comments on commit 9a294f3

Please sign in to comment.