Replace Test-Unit with Rspec

Maybe a dump question…

Why is Test-Unit the default test framework when it’s not the most popular?

It there’s not a good reason, would Rails 4 be a good time to replace Test-Unit with Rspec?

Rails 4 actually uses minitest - which also offers a “lite” version of the spec style matchers.

As for specifically why rspec is not the default, I suggest you google “DHH rspec” :wink:

Because there is consensus it is what we want to ship. We like very
much the simplicity of Test::Unit.

Rails core chooses the default stack based on what we believe is a
good set of defaults. Popularity is not relevant for that criteria.

At the same time, Rails allows you to switch to your preferred options.

Support for minitest’s spec DSL was recently removed from Rails 4. If you want to use it you will need a gem like minitest-rails.

Because Rails is omakase and DHH is the chef :wink:

Popularity is not the deciding factor in what’s the default in Rails. Popularity comes and goes and it makes no sense to keep changing defaults to fit the flavour of the month.

People say the same thing about ERB vs HAML vs SLIM.

If you want a different default, add it to your configuration and you’re done. Or use your own app templates.