thoughtbot/shoulda-matchers — pull request #249 by cbandy (2013-03-10 05:35:41+00:00)
Title: Urgent: Specs are broken

Commit af8f9a7bffa238db2648dfc28f23b7618f6881f2 completely broke the specs. For example, the following two changes don't fail:

```diff
--- a/spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb
+++ b/spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb
@@ -8,7 +8,7 @@ describe Shoulda::Matchers::ActionController::RedirectToMatcher do

it 'rejects redirecting to a different url' do
controller_redirecting_to('/some/url').should_not
- redirect_to('/some/other/url')
+ redirect_to('/some/url')
end

it 'accepts redirecting to that url in a block' do
```
```diff
--- a/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb
+++ b/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb
@@ -95,7 +95,7 @@ describe Shoulda::Matchers::ActiveModel::AllowValueMatcher do
context 'with no values' do
it 'raises an error' do
expect { allow_value.for(:baz) }.to
- raise_error(ArgumentError, /at least one argument/)
+ raise_error(ArgumentError, /at least two argument/)
end
end

```

I "fixed" everything that I could grep, but this needs careful review.

```shell
grep -rn -e 'raise_exception$' -e 'should$' -e 'should_not$' -e 'to$' spec
```

Unfortunately, this also breaks the build. Bisecting seemed hard (since the tests don't work) so I didn't try.

Other code that uses this "style" should probably also be checked.