Skip to content
Commits on Mar 30, 2013
  1. @myronmarston
  2. @myronmarston

    Merge pull request #257 from marcandre/ruby_21

    myronmarston committed
    Ruby 2.1 compatibility
  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.

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

    Changelog entry for #250.

    myronmarston committed
    [ci skip]
  2. @myronmarston

    Merge pull request #250 from rspec/externalize_methods_and_mock_state

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

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

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

    Rename `tracked_klasses` to `tracked_classes`.

    myronmarston committed
    As per @dchelimsky's suggestion.
  6. @myronmarston

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

    myronmarston committed
    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.
Commits on Mar 27, 2013
  1. @jferris
  2. @jferris

    Clear messages received when mocks reset

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

    Fix spy failures on 1.8

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

    Fix specs on 1.8.7.

    myronmarston committed
    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.
  2. @myronmarston

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

    myronmarston committed
    - 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.
  3. @myronmarston

    Extract rspec_reset/rspec_verify into a spec helper method.

    myronmarston committed
    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.
Commits on Mar 23, 2013
  1. @myronmarston
  2. @myronmarston

    Remove __mock_expectation.

    myronmarston committed
    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.
  3. @myronmarston

    Refactor specs to use public instead of private APIs.

    myronmarston committed
    - 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.
  4. @myronmarston

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

    myronmarston committed
    Conflicts:
    	lib/rspec/mocks/framework.rb
  5. @myronmarston

    Clarify changelog entry.

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

    Merge pull request #247 from JonRowe/double_array_bug

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

    update change log

    JonRowe committed
  8. @JonRowe
Commits on Mar 22, 2013
  1. @jferris
Something went wrong with that request. Please try again.