bcardarella / valid_attribute

Minimalist validation BDD for ActiveModel specs
178 stars 18 forks source link

Add alias to Matcher for RSpec v3.0 #34

Closed m5rk closed 10 years ago

m5rk commented 10 years ago

The following RSpec:

expect(registration).to have_valid(:social_security_number).when '123-45-6789', '123456789'

produces this warning when used with RSpec v3.0:

ValidAttribute::Matcher implements a legacy RSpec matcher
protocol. For the current protocol you should expose the failure messages
via the `failure_message` and `failure_message_when_negated` methods.

This PR simply creates an alias to silence this warning.

m5rk commented 10 years ago

33 does this (using alias instead of alias_method, which doesn't seem significant) and does other stuff as well, so I'm closing this in favor of that one.