RSpecって何?
前々から気になっていたので,ググって見た.そしたら,速攻でかくたにさんの書いたドキュメントが見つかった.
http://kakutani.com/trans/rspec/TUTORIAL_ja.html
う〜ん,振舞駆動開発…TDDみたいなもんね….
Pan% echo "1.should_not_equal 1" > one.rb Pan% spec one.rb /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.1/lib/spec/expectations/should/base.rb:17:in `fail_with_message': 1 should not equal 1 (Spec::Expectations::ExpectationNotMetError) from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.1/lib/spec/expectations/should/not.rb:67:in `__delegate_method_missing_to_target' …
ってもの凄く怒られたんだけれど,何これ.
Pan% echo "1.should_not_equal 2" > one.rb Pan% spec one.rb Finished in 1.1e-05 seconds 0 specifications, 0 failures
これはエラー出ないのに!もうボクはassert_equalで良いです.