rspec-expectations
rspec-expectations copied to clipboard
Provides a readable API to express expected outcomes of a code example
```ruby [14] pry()> rtn.class # => Pathutil [15] pry()> rtn.end_with?("/hello") # => true [16] pry()> expect(rtn).to end_with("/hello") RSpec::Expectations::ExpectationNotMetError # => : expected # to end with "/hello", but it cannot...
In the following scenario, the `change` matcher becomes slightly more unwieldy than `existing = ...; ...; expect(...).to eq(existing)` because it does not include a diff, whereas the `eq` matcher does:...
Super stoked to see `with_captures` ship! Now that I'm able to use this feature in practice, I'm finding the first glaring oversight with our implementation. When a with_captures match fails,...
Running the following spec: ``` ruby describe 'compound expectation' do context 'with 2 matchers' do it 'indents the messages properly' do expect { :nothing } .to change { @foo }...
@myronmarston @JonRowe Does it make sense to have some like this: ``` ruby Then /^the following files should (not )?exist:$/ do |negated, files| files = files.rows.flatten RSpec::Matchers.scope do if negated...
I think it would be useful to expose the expected and actual values in the `ExpectationNotMetError` exception. This would make it easier for other code bases to use expect() assertions,...
See rspec/rspec-core#1738 and rspec/rspec-core#1812 for examples of how to do this. (That's where we applied optimizations to rspec-core).
The current [output matcher](http://rubydoc.info/gems/rspec-expectations/RSpec/Matchers:output) is not considered thread safe. Rails had a similar feature [`capture`](http://api.rubyonrails.org/classes/Kernel.html#method-i-capture) and [`silence`](http://api.rubyonrails.org/classes/Kernel.html#method-i-silence) which were both [recently](https://github.com/rails/rails/pull/13392) [deprecated](https://github.com/rails/rails/commit/af2ffa8c79e69f99f6eec0aac76737a050bbd06e). This caused issues with the ammeter gem which...
When creating a custom matcher and using it with a mock argument expectation, the `===` method should also be defined, otherwise, the match will fail. Example: ``` ruby expect(instance).to receive(:method).with(a_matcher(1))...
We've had a few issues and pull requests dealing with diffing, but I think we need a more holistic solution. There are a growing number of diffing solutions out there...