Skip to content

Commit

Permalink
Merge pull request #1467 from glaucocustodio/raise-error-block-example
Browse files Browse the repository at this point in the history
Add example on how to use raise_error with block
  • Loading branch information
pirj authored and JonRowe committed Jul 15, 2024
1 parent 4dd7844 commit e9234d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions features/built_in_matchers/raise_error.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Feature: `raise_error` matcher
expect { raise "oops" }.to raise_error(RuntimeError, "oops")
expect { raise "oops" }.to raise_error(RuntimeError, /op/)
expect { raise "oops" }.to raise_error(an_instance_of(RuntimeError).and having_attributes(message: "oops"))
expect { raise "oops" }.to raise_error(MyError) do |exception|
expect(exception.whatever).to match(/op/)
end
```

Scenario: Expecting any error
Expand Down

0 comments on commit e9234d5

Please sign in to comment.