rspec-expectations icon indicating copy to clipboard operation
rspec-expectations copied to clipboard

Provides a readable API to express expected outcomes of a code example

Results 67 rspec-expectations issues
Sort by recently updated
recently updated
newest added

## The problem I have an app which prints some output only if the standard output is a TTY. I'd say it's a relative standard practice: ```ruby puts "Whatever" if...

Well, aside from a few lines in two other PRs (https://github.com/rspec/rspec-expectations/pull/1457 and https://github.com/rspec/rspec-expectations/pull/1456) that needed non-spec changes. First, I found and marked all of the segments that seem to be...

The new composable matchers are awesome and I'm hoping to make use of them. I think it makes sense to format the expectations using the `description` rather than `inspect`, but...

Currently, if you have an example like `expect(array1).to eq(array2)` a diff of the arrays will only show if both arrays once flattened contain only strings, and at least one of...

This hopefully resolves #1132 and #1288 - essentially, if you leave `strict_predicate_matchers` disabled and use a null-object spy like this: ``` let(:thing) { spy('my thing') } it "does the thing...

We did this previously in rspec-core in rspec/rspec-core#1905. All code that is not currently covered should be looked at, and it should be determined which of these categories it's in:...

### Subject of the issue Rails 7.1 added [Object#with](https://api.rubyonrails.org/classes/Object.html#method-i-with) which conflicts with `receive` and `have_received` that define a #with method (chain :with) when used via an alias_matcher. Related issue: https://github.com/rspec/rspec-expectations/issues/1437...

### Subject of the issue My project has a custom matcher defined with an optional keyword arg. After upgrading to RSpec 3.13, I get an `ArgumentError` that indicates that RSpec...

This PR addresses issue #1191 for ruby >= 2.1.9. Previously, a few parts of the `Include` matcher assumed all `Range`s were iterable. This caused it to raise errors like `TypeError:...

## Summary Pattern-matching has been available since Ruby 3.0. How about providing this as a RSpec matcher? ## Examples ### Basic example ```ruby # Pass expect([1, 2, 3]).to match_pattern([Integer, Integer,...