rspec/rspec-expectations — pull request #393 by myronmarston (2013-12-19 07:39:32+00:00)
Title: Support composable matchers

This is still a bit WIP but it's much further along than the last WIP PR and I wanted to open the PR and start the code review process. I applied the things discussed with @xaviershay and @JonRowe from #388.

Still TODO:

- [ ] The rbx build is failing for some reason. Figure out why.
- [ ] Finish defining all the matcher aliases.
- [ ] Figure out how to easily document the aliases in the YARD docs so it makes it clear they are aliases.
- [ ] Update the README with examples showing how to compose matchers
- [ ] Update the YARD doc comments above the `RSpec::Matchers` module that discusses the matcher protocol so that it mentions how the composing works (e.g. the use of `===`).
- [ ] Add a cuke demonstrating this.
- [ ] Given that many matchers do not support passing matchers as args (e.g. because the semantics would not make sense), should we explicitly document which matchers support it? (Note that all matchers will support being passed as an arg to another matcher -- it's just that some matchers aren't designed to receive a matcher as an arg).
- [ ] Consider updating the `match` matcher to be composable.
- [ ] Figure out a better algorithm for the `match_array` matcher to get the pending spec to pass.

The last item in particular is stumping me -- I need help on that one! See the pending spec I left in `match_array_spec.rb` for what I'm talking about.

Even though I have a lot of TODOs left, feedback is welcome whenever anyone wants to give it. I'll be sure to comment here when I everything I'm planning to do is complete.

/cc @xaviershay @JonRowe @soulcutter @samphippen @alindeman

Closes #280.