You are previewing The Rails™ 3 Way, Second Edition.

The Rails™ 3 Way, Second Edition

Cover of The Rails™ 3 Way, Second Edition by Obie Fernandez Published by Addison-Wesley Professional
O'Reilly logo

Chapter 18. RSpec

I do not think there is any thrill that can go through the human heart like that felt by the inventor as he sees some creation of the brain unfolding to success.

—Nikola Tesla

RSpec is a Ruby domain-specific language for specifying the desired behavior of Ruby code. Its strongest appeal is that RSpec scripts (or simply specs) can achieve a remarkable degree of readability, letting the authors express their intention with greater readability and fluidity than is achievable using Test::Unit’s methods and assertions.

RSpec::Rails, a drop-in replacement for the Rails testing subsystem supplies verification, mocking, and stubbing features customized for use with Rails models, controllers, and views. Since switching to RSpec I ...

The best content for your career. Discover unlimited learning on demand for around $1/day.