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.
Webinar: 8 Signs You’re Beyond Cron
On Demand NOW
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.View Now!
Web Development News
|Dr Hjkl on the Command Line||May 21, 2015|
|Initializing and Managing Services in Linux: Past, Present and Future||May 20, 2015|
|Goodbye, Pi. Hello, C.H.I.P.||May 18, 2015|
|Enter to Win Archive DVD + Free Backup Solution||May 18, 2015|
|Using Hiera with Puppet||May 14, 2015|
|Urgent Kernel Patch for Ubuntu||May 12, 2015|
- Initializing and Managing Services in Linux: Past, Present and Future
- Dr Hjkl on the Command Line
- Goodbye, Pi. Hello, C.H.I.P.
- Using Hiera with Puppet
- Gartner Dubs DivvyCloud Cool Cloud Management Vendor
- Mumblehard--Let's End Its Five-Year Reign
- Enter to Win Archive DVD + Free Backup Solution
- Infinite BusyBox with systemd
- It's Easier to Ask Forgiveness...
- Urgent Kernel Patch for Ubuntu