Add Logical Or example to RSpec (#1554)

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
This commit is contained in:
Mike Harrison 2022-04-06 21:23:56 -04:00 committed by GitHub
parent cd27a164b3
commit 1c43d9feb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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