Video description
Master the syntax and structure of RSpec, the most popular Ruby Gem for testing right from scratch!
About This Video
- Master the syntax and structure of RSpec, the most popular Ruby Gem for testing
- Explore the wide collection of RSpec matches available to test your code
- Utilize test-driven development principles to design and implement clean test specs in Ruby
In Detail
This course offers a comprehensive overview of the RSpec testing library for the Ruby programming library. RSpec is the most popular Ruby Gem of all time, with over 300 million downloads to date. If you are new to the topic, testing is the practice of writing code that confirms that other code works as expected. Tests control regressions, which are changes to the code that breaks the program.
The benefits of testing extend beyond the codebase. Adopting a test-driven approach will also make you a better developer. Tests force you to think critically about a program and its features: classes, objects, methods, and more.
This course begins with the essentials and proceeds to more complex topics, including installation, project initialization, Test-Driven Development (TDD), let variables, before and after hooks, subjects, shared examples, shared context, built-in matches, mocks and doubles, instance doubles, and class doubles.
At the completion of this course, you will have acquired hands-on Ruby testing experience with this awesome RSpec library.
Audiene
Programmers who want to explore the fundamentals of testing and TDD and intermediate Ruby developers interested in upgrading their skillset will benefit from this course. Knowing any text editor (VS Code is recommended) would be beneficial. No previous testing experience is needed!
Publisher resources
Table of contents
-
Chapter 1 : Introduction
- Welcome to RSpec
- Unit Tests versus End-to-End (E2E) Tests
- Installing RSpec
- Starting a Project with rspec --init
- Test-Driven Development
- The Describe Method
- The it Method
- The Expect and Eq Methods
- Reading Failures
- Making the Specs Pass
- Multiple Examples in Example Group
- Fixing Failing Specs Again
- Reducing Duplication - Before Hooks and Instance Variables
- Reducing Duplication: Helper Methods
- Problems with Mutation
- Reducing Duplication: The let Method
- Custom Error Messages
- The context Method and Nested Describes
- Before and After Hooks
- Nested Logic: Hooks
- Nested Logic: Overwriting Let Variables
- Chapter 2 : Subjects, Shared Examples, and Shared Context
-
Chapter 3 : Built-In Matchers
- The not_to Method
- Equality Matchers I (eq and eql)
- Equality Matchers II (equal and be)
- Comparison Matchers
- Predicate Matchers
- all Matcher
- be Matcher (Truthy, Falsy and Nil Values)
- change Matcher
- contain_exactly Matcher
- start_with and end_with Matchers
- have_attributes Matcher
- include Matcher
- raise_error Matcher
- respond_to Matcher
- satisfy Matcher
- not_to Method
- Compound Expectations
- Chapter 4 : Mocks
- Chapter 5 : Conclusion
Product information
- Title: Testing Ruby with RSpec: The Complete Guide
- Author(s):
- Release date: August 2019
- Publisher(s): Packt Publishing
- ISBN: 9781839219474
You might also like
video
Python Fundamentals
51+ hours of video instruction. Overview The professional programmer’s Deitel® video guide to Python development with …
book
The Ruby Workshop
Cut through the noise and get real results with a step-by-step approach to learning Ruby programming. …
book
Python Crash Course, 2nd Edition
This is the second edition of the best selling Python book in the world. Python Crash …
video
Learn to Code with Ruby
A comprehensive introduction to coding with the Ruby programming language. Complete beginners welcome! About This Video …