From 1c43d9feb43162366b622d7b3c0b3c6288289eb6 Mon Sep 17 00:00:00 2001 From: Mike Harrison Date: Wed, 6 Apr 2022 21:23:56 -0400 Subject: [PATCH] Add Logical Or example to RSpec (#1554) Co-authored-by: Rico Sta. Cruz --- rspec.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rspec.md b/rspec.md index 9c4301f6b..415b4cc30 100644 --- a/rspec.md +++ b/rspec.md @@ -79,6 +79,14 @@ expect(5).to be_between(1, 10) expect(5).to be_within(0.05).of value ``` +### Compound expectations + +```rb +expect(1).to (be < 2).or be > 5 +``` + +Use `or`/`and` to string multiple matchers together. See: [Compound expectations](https://relishapp.com/rspec/rspec-expectations/docs/compound-expectations) + ### Comparison ```rb