The Ruby on Rails and ClojureScript experts

Aug 8, 2012

Some good thoughts about how to name and write specs in Ruby/RSpec. However I agree that there seems to be a bit too much abstraction/duplication and prefer the first commenter’s approach:

I worry about duplicating equality comparisons, so I’d probably do this instead, in each spec: convert(1).should == ‘I’; convert(2).should == ‘II’, and so on. Then I define #convert inside my context to invoke Calculator.convert(actual). Not quite as cute, but avoids reimplementing parts of should equal to, as your example has done.

Link: CranialPulse: Specify What, Not How via www.cranialpulse.com