|||

Video Transcript

X

Heroku Loves RSpec

RSpec 1.1 is now a part of the default plugin kit for Heroku apps.

We’ve been fans of RSpec for a while now, and feel that it represents the future of TDD/BDD for the Rails world. If you’re not familiar with RSpec, read up and then give it a try.

You don’t need to install anything to use RSpec in your Heroku app, but you do need to initialize the spec/ and stories/ directories by running the rspec generator. Just open the Generate dialog, type in rspec, and click Run.

Once you’ve written some specs, you can run them the usual way: open a rake console and type spec. You can still run your Test::Unit tests with the test command, or you can run tests followed by spec with default.

RSpec terminal output screenshot

Don’t worry, support for Test::Unit won’t be going away any time soon – but we do encourage you to consider RSpec the next time you create a new model. Use the generate command rspec_model instead of the usual model to get a blank spec created for you. Or, use rspec_model <model_name> against an existing model and it will generate the spec (in spec/models) without overwriting the existing model or migration.

Originally published: January 03, 2008

Browse the archives for news or all blogs Subscribe to the RSS feed for news or all blogs.