Course Overview
Welcome to Testing Ruby with RSpec: The Complete Guide!
This course offers a comprehensive overview of the RSpec testing library for the Ruby programming language. RSpec is the most popular Ruby Gem of all time, with over 300 million downloads to date.
If you're new to the topic, testing is the practice of "writing code that confirms that other code works as expected". Tests control for regressions, which are changes to the code that break the program. Tests give you the confidence to refactor existing code because you know that you will honor the original purpose of the code.
The benefits of testing extend outside of your codebase. In this course, we'll cover test-driven development (TDD), a methodology in which we write our tests first, before the implementation. Test-driven development often leads to simpler, more decoupled code. Thus, testing can make you a better developer. Tests force you to think critically about the program and its features: the classes, the objects, the methods and more.
Testing Ruby with RSpec begins with the RSpec 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 Matchers
Mocks and Doubles
Instance Doubles
Class Doubles
As a software engineer and consultant who's worked with Ruby for 5+ years, I'm excited to introduce you to the awesome RSpec library, its elegant syntax, and all of its fun quirks.
Thanks for checking out the course!
FAQ
FAQ area empty
Course curriculum
-
Welcome to RSpec
783 Xem trước -
About Me
56 Xem trước -
Unit Tests vs End-to-End (E2E) Tests
556 Xem trước -
Setup Ruby on macOS Computers
Xem trước -
Setup Ruby on Windows Computers
Xem trước -
Install RSpec
191 Xem trước -
Install Visual Studio Code for macOS
Xem trước -
Start a Project with rspec --init
617 -
Download Course Files (Optional)
-
Test-Driven Development
328 -
The describe Method
282 -
The it Method
333 -
The expect and eq Methods
481 -
The describe, it and expect Methods
-
Reading Failures
449 -
Making the Specs Pass
537 -
QUIZ: TDD and RSpec Methods
-
Multiple Examples in Example Group
481 -
Fixing Failing Specs Again
503 -
Making Specs Pass
-
Reducing Duplication - Before Hooks and Instance Variables
658 -
Reducing Duplication: Helper Methods
252 -
Problems With Mutation
363 -
Reducing Duplication: The let Method
905 -
Custom Error Messages
279 -
Removing Duplication
-
The context Method and Nested Describes
497 -
Before and after Hooks
547 -
Nested Logic: Hooks
720 -
Single Context Hooks
-
Multi-Context Hooks
-
Nested Logic: Overwriting Let Variables
533
-
The not_to Method
278 -
Equality Matchers I (eq and eql)
330 -
Equality Matchers II (equal and be)
590 -
Comparison Matchers
363 -
Equality and Comparison Matchers
-
Predicate Matchers
465 -
All Matcher
380 -
Be Matcher (Truthy, Falsy and Nil Values)
443 -
Predicate, all and be Matchers
-
Change Matcher
602 -
Contain_exactly Matcher
246 -
Have_attributes Matcher
275 -
Include Matcher
376 -
Start_with and end_with Matchers
360 -
Raise_error Matcher
551 -
Respond_to Matcher
541 -
Satisfy Matcher
582 -
Not_to Method
501 -
Compound Expectations
377 -
Compound Expectations
Requirment
-
Intermediate knowledge of the Ruby programming language (classes, objects, blocks, etc)
-
Modern version of Ruby (>3.0)
-
Text editor (VSCode is recommended)
Outcomes
-
Master the syntax and structure of RSpec, the most popular Ruby Gem for testing
-
Utilize test-driven development principles to design and implement clean test specs in Ruby
-
Explore the wide collection of RSpec matchers available to test your code
-
Reduce dependencies in your test suite by mocking objects with class and instance doubles
0 Student
1 Course
0 review