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

Definition of #with_message is order-dependent #357

Closed
stephanschubert opened this issue Sep 13, 2013 · 1 comment · Fixed by #359
Closed

Definition of #with_message is order-dependent #357

stephanschubert opened this issue Sep 13, 2013 · 1 comment · Fixed by #359

Comments

@stephanschubert
Copy link

I'm using v2.3.0 and the availability of with_message is order-dependent:

it { should validate_numericality_of(:quantity).only_integer.is_greater_than(0).with_message("foo")  }

# => NoMethodError: undefined method `with_message` for #<Shoulda::Matchers::ActiveModel::ComparisonMatcher:...>

but this works:

it { should validate_numericality_of(:quantity).with_message("foo").only_integer.is_greater_than(0) }
@drapergeek
Copy link
Contributor

@Jazen I've verified this. I'm looking into a fix. Thanks for pointing it out!

drapergeek added a commit that referenced this issue Sep 16, 2013
* Verify that all submatchers respond to the necessary interface
* See: #357 for a reason why this is necessary
drapergeek added a commit that referenced this issue Sep 16, 2013
* Verify that all submatchers respond to the necessary interface
* See: #357 for a reason why this is necessary
drapergeek added a commit that referenced this issue Sep 16, 2013
* Verify that all submatchers respond to the necessary interface
* See: #357 for a reason why this is necessary
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

Successfully merging a pull request may close this issue.

2 participants