Archive for January, 2008

RSpec 1.1.1, Rails 2.0, and Possibly Legacy Tests Do Not Play Well Together

Tuesday, January 8th, 2008

From reading the change log and just the timing I thought that RSpec 1.1.1 worked with Rails 2.0. A few test failed but some of them were clearly bit rot, tests that had not been updated as I added and changed functionality. However others were more problematic. One of the fixtures is not loading at all. It’s unclear how it is different from the others. Running the tests twice in a row gave different failures. Running the tests with rake and with script/spec gave different failures.

One problem I just noticed with RSpec is that is hard or impossible to run individual tests within a file or even individual spec files. I don’t currently have any view tests or stories, so I plan to follow the examples and write a few. That should tell me if I am using obsolete features or what.

RSpec 1.1.1 Supports Rails 2.0 and Stories

Saturday, January 5th, 2008

The newest release of RSpec supports Rails 2.0. When I attended the Lonestar Ruby Conference, one of the talks was on RSpec. The speaker talked some on stories, a higher level construct tested at the application level in addition to the existing support for testing at the object level. It is a welcome addition. I like RSpec approach better than Test::Unit. However, without stories it wasn’t a complete replacement.

Over the month or so that I wasn’t using RSpec, some cruft crept in. I changed features in the application but didn’t update the RSpec files. Plus there were some features that the my RSpec scripts tested that my Test::Unit ones didn’t. I’ve fixed about half of the failing tests.