Permalink
Commits on Mar 30, 2013
  1. @myronmarston
  2. @myronmarston

    Merge pull request #257 from marcandre/ruby_21

    Ruby 2.1 compatibility
    myronmarston committed Mar 30, 2013
  3. @marcandre
  4. @marcandre
Commits on Mar 29, 2013
  1. @dchelimsky
  2. @myronmarston
  3. @myronmarston
  4. @myronmarston
  5. @myronmarston

    Deal with our recent changes to __mock_proxy in master.

    Proxies are no longer held internally in each mock'd object.
    myronmarston committed Mar 29, 2013
  6. @myronmarston
Commits on Mar 28, 2013
  1. @myronmarston

    Changelog entry for #250.

    [ci skip]
    myronmarston committed Mar 28, 2013
  2. @myronmarston

    Merge pull request #250 from rspec/externalize_methods_and_mock_state

    Externalize methods and state that was previously held on all objects.
    myronmarston committed Mar 28, 2013
  3. @myronmarston
  4. @myronmarston

    RSpec::Mocks.space.mock_proxy_for => RSpec::Mocks.proxy_for

    ...for a bit shorter, nicer API.
    myronmarston committed Mar 28, 2013
  5. @myronmarston

    Rename `tracked_klasses` to `tracked_classes`.

    As per @dchelimsky's suggestion.
    myronmarston committed Mar 28, 2013
  6. @myronmarston

    Make spec pending that intermittently fails on JRuby in 1.9 mode.

    I've spent a few hours troubleshooting this and haven't been able
    to make progress.  It's intermittent and bizarre.  For now, just
    making it pending.
    myronmarston committed Mar 28, 2013
Commits on Mar 27, 2013
  1. @jferris
  2. @jferris

    Clear messages received when mocks reset

    * Proxy objects for class methods/global objects persist between test runs
    
    Fixes #248.
    jferris committed Mar 27, 2013
Commits on Mar 26, 2013
  1. @jferris
  2. @jferris
  3. @jferris

    Fix spy failures on 1.8

    jferris committed Mar 26, 2013
  4. @jferris
  5. @jferris
Commits on Mar 25, 2013
  1. @myronmarston

    Fix specs on 1.8.7.

    Hashes are ordered on 1.9 but not on 1.8. Thus, we cannot count on
    the order the mock proxies will be reset or verified since they are
    held in a hash.
    myronmarston committed Mar 25, 2013
  2. @myronmarston

    Externalize methods and state that was previously held on all objects.

    - Remove `@mock_proxy` ivar
    - Remove `rspec_verify`, `rspec_reset`, `__mock_proxy` and `__remove_mock_proxy` methods.
    
    This is a refactoring that I'm doing to pave the way for the new expect
    syntax (#153). As that syntax "wraps" objects in order to mock or stub
    them, we need to externalize these methods and state. The methods directly
    on the object (e.g. `stub` and `should_receive`) will simply delegate to
    this external logic.
    
    This refactoring had some nice side benefits:
    
    - No need for the hacky YAML fix. It was only needed because we were storing
      `@mock_proxy` on the mocked object.
    - AnyInstance no longer needs to much with `dup`; again, this was only needed
      because it dup'd the `@mock_proxy` ivar.
    - The Marshal extension gets significantly simpler (again, due to not
      storing `@mock_proxy` on the object anymore).
    
    Rather than storing the mock proxies on the objects, we are now storing
    them in a hash, keyed by object_id.  This is pretty simple and consistent,
    but could be problematic for objects that muck with `object_id`. That method
    seems a bit sacred, though, so I'm not too worried about it.
    myronmarston committed Mar 18, 2013
  3. @myronmarston

    Extract rspec_reset/rspec_verify into a spec helper method.

    This refactoring is in prep for removing rspec_reset/rspec_verify
    from every object; by extracting it into a helper method it
    will make it easier to change w/o breaking specs.
    myronmarston committed Mar 24, 2013
Commits on Mar 23, 2013
  1. @myronmarston
  2. @myronmarston

    Remove __mock_expectation.

    We want to limit the number of methods added to all object.
    The use of `__send__` to get around this is a code smell
    but I believe it's preferable to polluting every object with
    an extra method.
    
    This was also necessary to get the spec I added in 512bbbf to pass.
    myronmarston committed Mar 23, 2013
  3. @myronmarston

    Refactor specs to use public instead of private APIs.

    - Just use the have_received matcher directly as its intended
      to be used, rather than invoking `matches?`, `does_not_match?`,
      etc. directly.
    - Don't test `__mock_expectation` directly. I'm planning to refactor
      things to remove this method, anyway.
    - Going through this exercise surfaced a few issues:
      - The failure messages when `with`, `at_least` or `at_most`
        constraints are used are quite confusing and should be improved.
        I left some TODOs in the specs to remind us to come back
        and revisit.
      - The count constraints create confusion when used with a
        negative expectation (e.g.
        `expect(dbl).not_to have_received(:a).at_most(3).times`
        is confusing and isn't specifying much. We should disallow
        them. I left a pending spec for this so we don't forget.
    - These changes were necessary to enable the removal of
      `__mock_expectation` (in my next commit) -- the current ones
      were coupled to the implementation, and did not allow that
      refactoring.
    myronmarston committed Mar 23, 2013
  4. @myronmarston

    Merge branch 'master' into thoughtbot-jf-jq-spies

    Conflicts:
    	lib/rspec/mocks/framework.rb
    myronmarston committed Mar 23, 2013
  5. @myronmarston

    Clarify changelog entry.

    Seems important to mention it was a problem with `Array(double)` but
    not with `[double]`.
    myronmarston committed Mar 23, 2013
  6. @myronmarston

    Merge pull request #247 from JonRowe/double_array_bug

    Fix a bug which prevented doubles being wrapped in an Array
    myronmarston committed Mar 23, 2013
  7. @JonRowe

    update change log

    JonRowe committed Mar 23, 2013
  8. @JonRowe
Commits on Mar 22, 2013
  1. @jferris