rspec/rspec-mocks — Issue #97: Stubbing with custom matchers is broken
Author: aslakhellesoy
Created: 2012-01-20 21:43:13+00:00
State: open

I tried to upgrade gherkin's specs from 2.7.0 to 2.8.0, and that broke a bunch of specs. I have isolated it to this:

```ruby
RSpec::Matchers.define :r do |expected|
match do |row|
def row.inspect
"r " + self.map{|cell| cell}.inspect
end
row.map{|cell| cell}.should == expected
end
end

describe 'Stubbing with custom matcher' do
it 'works with 2.7.0 but not with 2.8.0' do
x = Object.new
x.should_receive(:row).with(r(['1', '']), 1)
x.should_receive(:row).with(r(['', '4']), 2)

x.row(['1', ''], 1)
x.row(['', '4'], 2)
end
end
```

I haven't seen anything in the changelog about changing APIs, so I assume this is a regression?