Plaggerのテスト

ところで、久しぶりにnmake testしてみたら、結構怒られる。なんでかなと思ってみてみたら、少なくとも一部は、インストールしていない依存モジュールの存在チェックがされていないための模様。

--- t/plugins/Subscription-ConfigINI/subscription.t	(リビジョン 1039)
+++ t/plugins/Subscription-ConfigINI/subscription.t	(作業コピー)
@@ -1,8 +1,18 @@
 use strict;
 use FindBin;
 use File::Spec;
-use Test::More tests => 1;
+use Test::More;
 
+BEGIN {
+    eval "require Config::INI::Simple";
+    if ($@) {
+        plan skip_all => 'this test requires Config::INI::Simple';
+    }
+    else {
+        plan tests => 1
+    }
+}
+
 use Plagger;
 Plagger->bootstrap(config => \<<CONFIG);
 global:

hatenafotolife.tなどに見られるfile:://$FindBin::Bin/...系のテストはまた別の理由でこけているようですが、こんなパッチでひとまず解決。

--- t/core/hatenafotolife.t	(リビジョン 1039)
+++ t/core/hatenafotolife.t	(作業コピー)
@@ -4,6 +4,12 @@
 
 use Plagger;
 
+my $bin = $FindBin::Bin;
+if ($^O eq 'MSWin32') {
+    $bin =~ s|\\|/|g;
+    $bin =~ s/:/|/g;
+}
+
 Plagger->bootstrap(config => \<<CONFIG);
 global:
   log:
@@ -12,7 +18,7 @@
   - module: Subscription::Config
     config:
       feed:
-        - file://$FindBin::Bin/hatenafotolife.rdf
+        - file://$bin/hatenafotolife.rdf
   - module: Test::Hatena
 CONFIG

追いかけるのが面倒になったので全部は見ていませんが、とりあえずご報告。

#いまのところ面倒くさいからそうなっているけど、CPANにはMANIFEST.SKIPして入らないようになっているとの由。なる。