What is RSpec?
RSpec is a popular BDD testing library for Ruby. Tests written using RSpec describes what the software does and how the interface should behave. For this reason, we refer to RSpec tests as specs
What is BDD?
BDD is an approach to software development that combines Test-Driven Development, Domain-Driven Design, and Acceptance Test-Driven Planning. RSpec helps with the TDD part of that equation, focusing on the documentation and design aspects of TDD.
Why should we write tests?
- It builds a safety net thereby increases confidence
- The tests describe application behavior thereby helps to document the code
- It gives a faster feedback loop
- Helps to make sure the code is producing the results as expected
Note: This content is a condensed form of resources from various sources, created based on what I learned and understand. And, It’s part of our new series called “Learning Capsules” which will be shared on weekly basis in similar format.