thoughtbot/shoulda-matchers — pull request #246 by sj26 (2013-03-04 06:35:47+00:00)
Title: Add support for validation contexts

There's no easy way to test validation contexts with the current shoulda matchers. The context must be provided in the call to the instance's `valid?` method. This patch adds a simple way to optionally pass a context.

Example:

```ruby
class User
include ActiveModel::Model
validates_presence_of :email, on: :emailable
end

describe User do
it { should_not validate_presence_of(:email) }
it { should validate_presence_of(:email).on(:emailable) }
end
```