At the Forge - RSpec for Controllers
RSpec's “outside-in” approach to testing takes a bit of getting used to, but I increasingly have found it to be a method that forces me to think harder about my code, as well as about my testing strategy. That said, I'm not sure if I really have a strong preference for RSpec over similar BDD-style tools, such as Shoulda, which works with Ruby's traditional Test::Unit system. The bottom line is that you should try to include as much automated testing as possible in any software you design—not only because it will benefit your users, but also because it will benefit you as a developer.
The home page for RSpec is rspec.info, and it contains installation and configuration documentation, as well as pointers to other documents.
The Pragmatic Programmers recently released a book called The RSpec Book, written by RSpec maintainer David Chelimsky and many others actively involved in the RSpec community. If you are interested in using RSpec (or its cousin, the BDD tool Cucumber), this book is an excellent starting point.
An RSpec mailing list, which is helpful and friendly, but fairly high volume, is at groups.google.com/group/rspec.
Finally, a good introduction to RSpec and mocking is in The Rails Way, one of my favorite books about Rails, written by Obie Fernandez. This book describes mocking both within the context of RSpec and as a general testing tool when developing Rails applications.
Reuven M. Lerner, a longtime Web/database developer and consultant, is a PhD candidate in learning sciences at Northwestern University, studying on-line learning communities. He recently returned (with his wife and three children) to their home in Modi'in, Israel, after four years in the Chicago area.
Web Development News
- Readers' Choice Awards 2013
- Linux Kernel News - November 2013
- December 2013 Issue of Linux Journal: Readers' Choice
- Mars Needs Women
- RSS Feeds
- Raspberry Pi: the Perfect Home Server
- Sublime Text: One Editor to Rule Them All?
- Advanced Hard Drive Caching Techniques
- Web Administration Scripts
- IBM Will Minimize Impact of Future Disasters
- thanks for share, great
8 hours 47 min ago
- There are factors which are
13 hours 46 min ago
- Gnome 3 ?
14 hours 31 min ago
- Reply to comment | Linux Journal
18 hours 39 min ago
- "Redis RethinkDB 4.5%" on Best NoSQL Databases
1 day 4 hours ago
- on the ground
1 day 11 hours ago
- I was able to read the whole
1 day 12 hours ago
- since i have read the title i
1 day 15 hours ago
- Belanja Online Cari Voucher Diskon
1 day 16 hours ago
- The kernel doesn't really
2 days 4 hours ago