© Greg Donald 2024
G. DonaldHands-on Test-Driven Developmenthttps://doi.org/10.1007/978-1-4842-9748-3_5

5. Setting Up RSpec and FactoryBot

Greg Donald1  
(1)
Clarksville, TN, USA
 

RSpec1 is a testing framework for Ruby. RSpec is available to us as a domain-specific language2 (DSL) written in Ruby and used to test Ruby code. RSpec tests the behavior of Ruby code and considers itself to be a “behavior-driven development” (BDD) framework. RSpec is most widely used for testing Rails applications, but can be used to test any Ruby code.

Ruby on Rails by default comes with the testing framework Test::Unit. In the previous chapter when we used the rails new command to create our Rails blog application, we added the --skip-test option to disable Test::Unit ...

Get Hands-on Test-Driven Development: Using Ruby, Ruby on Rails, and RSpec now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.