The RSpec Book: Behaviour Driven Development with Rspec, Cucumber, and Friends
- Length: 448 pages
- Edition: 1
- Language: English
- Publisher: Pragmatic Bookshelf
- Publication Date: 2010-12-22
- ISBN-10: 1934356379
- ISBN-13: 9781934356371
- Sales Rank: #1044542 (See Top 100 Books)
You’ll get started right away with RSpec 2 and Cucumber by developing a simple game, using Cucumber to express high-level requirements in language your customer understands, and RSpec to express more granular requirements that focus on the behavior of individual objects in the system. You’ll learn how to use test doubles (mocks and stubs) to control the environment and focus the RSpec examples on one object at a time, and how to customize RSpec to “speak” in the language of your domain.
You’ll develop Rails 3 applications and use companion tools such as Webrat and Selenium to express requirements for web applications both in memory and in the browser. And you’ll learn to specify Rails views, controllers, and models, each in complete isolation from the other.
Whether you’re developing applications, frameworks, or the libraries that power them, The RSpec Book will help you write better code, better tests, and deliver better software to happier users.
Table of Contents
Part 1 Getting Started with RSpec and Cucumber
Chapter 1 Introduction
Chapter 2 Hello
Chapter 3 Describing Features
Chapter 4 Automating Features with Cucumber
Chapter 5 Describing Code with RSpec
Chapter 6 Adding New Features
Chapter 7 Specifying an Algorithm
Chapter 8 Refactoring with Confidence
Chapter 9 Feeding Back What We’ve Learned
Part 2 Behaviour-Driven Development
Chapter 10 The Case for BDD
Chapter 11 Writing Software That Matters
Part 3 RSpec
Chapter 12 Code Examples
Chapter 13 RSpec::Expectations
Chapter 14 RSpec::Mocks
Chapter 15 Tools and Integration
Chapter 16 Extending RSpec
Part 4 Cucumber
Chapter 17 Intro to Cucumber
Chapter 18 Cucumber Detail
Part 5 Behaviour-Driven Rails
Chapter 19 BDD in Rails
Chapter 20 Cucumber with Rails
Chapter 21 Simulating the Browser with Webrat
Chapter 22 Automating the Browser with Webrat and Selenium
Chapter 23 Rails Views
Chapter 24 Rails Controllers
Chapter 25 Rails Models
Appendix A RubySpec
Appendix B RSpec’s Built-in Expectations
Appendix C Bibliography