Re: [wrong] Integration bug with RSpec: can't alias :expect, :assert (#6)

Skip to first unread message

Alex Chaffee

May 15, 2011, 10:59:34 AM5/15/11
to, David Chelimsky, Steve Conover
Yikes! Thanks for finding this. Tests that always pass are even worse than tests that always fail!

I'll update the readme right away. As for the fix, let me think about it once I've had a bit more coffee :-). I think that the simple configuration option is probably best. Except for this name collision, Wrong is pretty much invisible to RSpec, and it may be overkill to make a whole pluggable library system for something that already (nearly) works fine with a require.

 - A

On Sun, May 15, 2011 at 7:43 AM, dchelimsky <> wrote:
The [README]( says you can alias `assert` with `expect` when using RSpec. This actually doesn't work because rspec-expectations already defines `expect` (as an alias for `lambda`). The outcome is that all examples pass whether they should or not.

RSpec recently added a hook to configure the assertion/expectation library to be either rspec-expectations, stdlib (t/u assertions on 1.8, minitest assertion on 1.9), or both. I tried setting this to use stdlib so rspec-expectations wouldn't be loaded (and define `expect`, but then there were errors because `wrong` assigns `failure_class` the value `RSpec::Expectations::ExpectationNotMetError`, which lives (as its name suggests) in rspec-expectations.

Since this isn' t working as advertised, it'd be great if you changed the README to exclude the bit about aliasing `assert` with `expect`.

Once that's done, I'd like to get this working and am happy to collaborate with you to do so. The question is what belongs where? One possibility is for RSpec to expose a configuration option that turns off the `lambda`, `expect` alias. Another is for RSpec to expose a better extension point for this sort of integration - something like the [mock framework adapters]( I'm sure there are several other approaches we could take.


Reply to this email directly or view it on GitHub:


Alex Chaffee - -
Stalk me: | |
Reply all
Reply to author
0 new messages