
DHH Offended By RSpec, Says Test::Unit Is Just Great - thehodge
http://www.rubyinside.com/dhh-offended-by-rspec-debate-4610.html
======
jacques_chester
I spent about 6 months working at a Rails shop.

The best thing about the Rails community is the speed at which great new tools
appear.

The worst thing about the Rails community is the speed at which great new
tools are abandoned.

------
ekidd
While DHH has remarkably good taste—and he has, in fact, helped make code more
beautiful throughout our industry—his taste is not necessarily perfect.

Exhibit A: Rails fixtures.

When using fixtures, you end share a single set of objects between all your
tests. And sooner or later, your tests will become tightly coupled via the
fixtures: To add a new test, you must add some new records. But when you add
those records, some other tests break.

If you instead use an object factory like machinist or factory_girl, you can
create objects at the start of each test, and fill in random values for any
fields you don't care about. This makes each test independent of the others,
and it keeps the code and data in one place.

So if we admit that DHH's taste in testing is potentially imperfect, what does
that mean for the Test::Unit versus RSpec debate? Not much.

Some people like Test::Unit. It's a fine library. I prefer RSpec, because it's
a better match to how I think. And many of the testing libraries I want to use
are actually work better with RSpec.

Oh, and if Cucumber is a bad match for your project, try Steak. It's easier to
set up, and you write ordinary Ruby code.

------
cageface
I get by just fine with Test::Unit too. RSpec smelled like gratuitous
complexity from the get-go. Wasn't the whole point of Rails to get back to
doing things simply?

~~~
jacques_chester
I'm ambivalent about RSpec, but the concept of a structured requirements
language (which is front-end of Cucumber) is a good one.

Cucumber grew out of testing; it'd be interesting to see the problem
approached from the other end.

Suppose you were designing a language, _ab initio_ , for sharing requirements
with end-users. What would it look like?

I've seen Steve McConnell mention "Planguage" by Tom Gilb, but online
resources are scarce.

~~~
cageface
I have never, personally, worked with a client that was willing to work
consistently at the level of detail that Cucumber provides. I suppose if I had
such a client I might find it useful.

For communicating requirements _among_ developers I think plain Ruby is
already readable enough.

~~~
jacques_chester
What level of detail _do_ you use with clients?

~~~
cageface
Wireframes for UI, informally written use cases for features. I try to get
working prototypes up on screen as quickly as possible.

------
BvS
DHH noted that this gist comparing some Test::Unit tests to RSpec triggered
his statements: <https://gist.github.com/893027>

------
ludicast
I'm an RSpec user, but do feel that Ruby is self-documenting enough that it
can be used as is.

------
Semiapies
Flagged for Twitter drama.

~~~
msbarnett
Downvoted for non-contributive noise.

For future reference:

<http://ycombinator.com/newsguidelines.html>

 _Please don't submit comments complaining that a submission is inappropriate
for the site. If you think something is spam or offtopic, flag it by going to
its page and clicking on the "flag" link. (Not all users will see this; there
is a karma threshold.) If you flag something, please don't also comment that
you did._

