Yacafiの01_podspell.tのテストが一部とおるようにしてみた
テストとおらなくても動いてたのでスルーしてたけど、MENTAをmake testしてみたらきれいにパスしたので、加筆してみた。
MacでYacafiをmake testすると、以下の状態になってた。
t/00_compile........ok xt/01_podspell......sh: spell: command not found Died at /opt/local/lib/perl5/site_perl/5.8.9/Test/Spelling.pm line 54. # Looks like your test exited with 127 before it could output anything. xt/01_podspell...... Dubious, test returned 127 (wstat 32512, 0x7f00) Failed 1/1 subtests xt/02_perlcritic....1/1 # Failed test 'Test::Perl::Critic for "lib/Yacafi.pm"' # at /opt/local/lib/perl5/site_perl/5.8.9/Test/Perl/Critic.pm line 99. # # Perl::Critic found these violations in "lib/Yacafi.pm": # Expression form of "eval" at line 246, column 9. See page 161 of PBP. (Severity: 5) # Expression form of "eval" at line 412, column 22. See page 161 of PBP. (Severity: 5) # Looks like you failed 1 test of 1. xt/02_perlcritic.... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests xt/03_pod...........ok Test Summary Report ------------------- xt/01_podspell (Wstat: 256 Tests: 0 Failed: 0) Non-zero exit status: 1 Parse errors: Bad plan. You planned 1 tests but ran 0. xt/02_perlcritic (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=4, Tests=3, 1 wallclock secs ( 0.03 usr 0.01 sys + 1.44 cusr 0.10 csys = 1.58 CPU) Result: FAIL Failed 2/4 test programs. 1/3 subtests failed.
そもそもspellなんて扱えたかなーと確認してみたところ、そんなものなかった。どうしたものかとおもってしらべてみたら、Test::Spellingな記事を発見。とりあえず張られてたソースをぺたっと01_podspell.tにはりつけて実行してみた。ついでにmacportにaspellがあったのでいれてみた。
$sudo port password: >search spell aspell @0.60.6 (textproc) Spell checker with better logic than ispell >install aspell
$ make test xt/01_podspell......Error: No word lists can be found for the language "en_US". Died at /opt/local/lib/perl5/site_perl/5.8.9/Test/Spelling.pm line 54. # Looks like your test exited with 1 before it could output anything. xt/01_podspell...... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests
en_USなんてどのリストから探してくるのやら、とおもいながら検索した所、~/.aspell.confに
lang en_US
といれればいい、とのことだったけど、それでも動かない。macportにリストっぽいものないかなーとおもってしらべてみたら、
$ sudo port password: > search aspell . . aspell-dict-en @6.0 (textproc) English dictionary for aspell . .
もしかして辞書のことかなとおもってインストール。
> install aspell-dict-en
そして再びmake test
xt/01_podspell......1/1 # Failed test 'POD spelling for lib/Yacafi.pm' # at /opt/local/lib/perl5/site_perl/5.8.9/Test/Spelling.pm line 80. # Errors: # Kazuhiro # Osawa # Riedel # shibuya # tokuhirom # yappo # Looks like you failed 1 test of 1. xt/01_podspell...... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests
なんか変わった。Errorのワード一覧(というかHN一覧な気がする)をpodspellに追記。
__DATA__ Kazuhiro Osawa yappo <at> shibuya <döt> pl Yacafi CGI Kazuhiro Osawa Riedel shibuya tokuhirom yappo
そしてmake test。
.. $ make test xt/01_podspell......ok ..
とりあえず、podspellをmacでパスする場合はこれらの手順が必要っぽい、てことでした。