Entries from 2009-08-02 to 1 day
久しぶりに、rspec見直してたら、lambda {...}.should の代わりに、expect {...}.toが1.2.5から、使えるようになっていたのね。lambdaやだなぁと思っていたので、ちょっと、すっきりした。 expect { this_block }.to change{this.expression}.from(old_value…
Custom Assertionのような事がしたい時に、Extract Methodから、うまく導けないからだろう。 ステップが、もう少しいる。
http://xunitpatterns.com/ResultVerification.html http://xunitpatterns.com/Using%20Test%20Doubles.html あたり。 ResultVerificationも好きだが、Test Doubles。 この本の見せ場の1つ。最近、経験が先にあり、あとで言葉を知るケースが増えてきた。 言…