O'Reilly logo

The Rails 5 Way, Fourth Edition by Kevin Faustino, Obie Fernandez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 23 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 developers communicate their intention with greater readability and expressiveness than is achievable using the standard Rails testing framework.

23.1 Introduction

Since RSpec scripts are so readable, I can’t really think of a better way of introducing you to the framework than to show part of a real-world spec. The following code is excerpted and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required