Fix tests dying in absence of bootstrap scripts.
[catagits/Gitalist.git] / t / opml.t
index b5bb93c..1b8ac02 100644 (file)
--- a/t/opml.t
+++ b/t/opml.t
@@ -1,10 +1,18 @@
 #!/usr/bin/env perl
 use FindBin qw/$Bin/;
-BEGIN { do "$FindBin::Bin/../script/env" or die $@ }
+BEGIN {
+    my $env = "$FindBin::Bin/script/env";
+    if (-r $env) {
+        do $env or die $@;
+    }
+}
+
 use lib "$Bin/lib";
 use TestGitalist;
+use HTTP::Request::Common;
+
+my $res = request(GET 'http://localhost/opml', 'Content-Type' => 'application/rss');
 
-my $res = request('/opml');
 ok $res->is_success;
 
 is $res->content_type, 'application/rss';