Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In custom matchers with fluent interfaces, show chained methods in description #1489

Closed
oveddan opened this issue Apr 17, 2014 · 1 comment
Closed

Comments

@oveddan
Copy link

oveddan commented Apr 17, 2014

Right now, if you do something like:

RSpec::Matchers.define :be_bigger_than do |first|
  match do |actual|
    (actual > first) && (actual < @second)
  end

  chain :but_smaller_than do |second|
    @second = second
  end
end


describe 5 do
  it { should be_bigger_than(4).but_smaller_than(6) }
end

The description reads:
"should be bigger than 4"

It would great if the description included the chained methods, so it would read like:
"should be bigger than 4 but smaller than 6"

@JonRowe
Copy link
Member

JonRowe commented Apr 18, 2014

Thanks for the suggestion, I'm closing this because it's on the wrong repo, but I've reopened it on rspec-expectations for you.

@JonRowe JonRowe closed this as completed Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants