Toxic Elephant

RSpec Still Sucks

Posted by matijs Sun, 25 Oct 2009 11:25:00 GMT

I run rake spec and get:

Test::Unit::AssertionFailedError in 'XmlController test_bad_format'
Expected response to be a <:missing>, but was <301>
/var/lib/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/test_case.rb:114:in `clean_backtrace'
./spec/controllers/xml_controller_spec.rb:152:in `test_bad_format'

So, things fail in xml_controller_spec, right? So, I run:

./script/spec spec/controllers/xml_controller_spec.rb

And I get this:

27 examples, 0 failures

WTF??

Yes, this turns out to be due to the fact that the spec in question was in its original form as migrated from Test::Unit. But that’s not really an excuse: Either Test::Unit style tests work in RSpec, or they don’t. They shouldn’t work some of the time. Now I suddenly can’t trust any of the Test::Unit style tests in Typo anymore: Are they passing because the code works, or because of some mystical internal RSpec magic?

I am mass-replacing lines of def test_bla_bla by it "test_bla_bla" do right now.

Posted in  | no comments | no trackbacks

No comments

No trackbacks

(leave url/email »)

Markdown enabled

Preview comment   

Toxic Elephant is Matijs van Zuijlen's weblog.

Powered

Categories

Archives