Toxic Elephant

Don't bury it in your back yard!

RSpec Still Sucks

Posted by matijs 25/10/2009 at 11h25

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.

Tags no comments no trackbacks

Comments

Comments are disabled