Development for Ruby.
To kick things off, install RSpec and run rspec --init
to
set up your project to use RSpec.
Start with a very simple example that expresses some basic desired behaviour.
Run the example and watch it fail.
Implement that basic behaviour...
Run the example and bask in the joy that is green.
Don’t rush ahead with more code. Instead, add another example and let it guide you to what you have to do next. And don’t forget to take time to refactor your code before it gets messy. You should keep your code clean at every step of the way.
This definitive guide from RSpec’s lead developer shows you how to use RSpec to drive more maintainable designs, specify and document expected behavior, and prevent regressions during refactoring. Build a project using RSpec to design, describe, and test the behavior of your code-whether you’re new to testing tools or an experienced developer.
Get the book from The Pragmatic BookshelfThe Testing Ruby Applications with RSpec screencast introduces the core RSpec libraries through the development of a small CLI card game. In addition to covering the technical aspects of using RSpec, it also covers best practices for using them so you get the most out of your test suite: different types of tests, what kinds of things to test, when different styles are appropriate.
Check out the screencast