Just do IT

思うは招く

Mechanize gem でテストをすると Queue not empty エラー

起きた問題

Mechanize gem を使い、テストを実行しても以下のエラーが出る。

sparklemotion/mechanize: Mechanize is a ruby library that makes automated web interaction easy.

# テスト
rails test

エラーメッセージ

Queue not empty, but all workers have finished. This probably means that a worker crashed and 1 tests were missed. (RuntimeError)

解決

結論からいうと、以下コマンドでテストが通った。

rake test

rails testではなく、rake testじゃないとダメだった。ドキュメントに書いてあったのに、いつもの感じでrails testしていた…。

学び

テストコマンドが指定されていたら、それで実行すること。