Add support for `expect(value)` syntax. #119

merged 9 commits into from May 22, 2012
Commits on May 9, 2012
  1. @myronmarston

    Add support for `expect(value)` syntax.

    myronmarston committed Mar 4, 2012
    Note: there's more to do here (documentation, etc); this is just a starting point for discussion and comments.
  2. @myronmarston

    Don't expose #target as a public API.

    myronmarston committed Mar 4, 2012
    Also, fix the spelling of the class while I'm at it.
  3. @myronmarston

    Add configuration API for choosing an expectation syntax.

    myronmarston committed May 9, 2012
    :should, :expect or both can be chosen.
  4. @myronmarston
Commits on May 10, 2012
  1. @myronmarston

    Refactor enabling/disabling of expectation syntaxes.

    myronmarston committed May 9, 2012
    * Fix build on JRuby. Our sandboxing via forking didn't work
      on JRuby since fork isn't available. On JRuby we just
      re-enable all syntaxes at the end of each sandboxed example.
    * Testing this revealed that the way I was restoring a disabled
      syntax didn't always work. Based on the random order, sometimes
      spec/rspec/matchers/be_spec.rb:427 would fail with
      "TypeError: bind argument must be an instance of Kernel".
    * Refactored main logic into new syntax module, that can add
      the syntaxes to any class or module. Kernel/RSpec::Matcher
      defaults are provided for convenience. This also fixes the
      bind failure, by redefining the methods anew rather than
      re-binding the old ones.
  2. @myronmarston
Commits on May 11, 2012
  1. @myronmarston

    Cleanup code a bit.

    myronmarston committed May 11, 2012
    - Remove bang from @justinko rightly pointed out, there's no corresponding bangless method so it didn't really follow convention here.
    - Use an early guarded return.
Commits on May 12, 2012
  1. @myronmarston

    Add yard docs for new modules.

    myronmarston committed May 12, 2012
    [ci skip]
  2. @myronmarston

    Add match_array matcher method for the old =~ array matcher.

    myronmarston committed May 12, 2012
    This is needed because we've decided not to support operator matchers off of `expect(value).to`, and `match_array` is the best name we've come up with for it.