Commits on Jan 11, 2014
  1. @myronmarston

    Merge pull request #524 from rspec/fix-null-object-visibility

    Fix null object visibility
    myronmarston committed Jan 11, 2014
  2. @myronmarston

    Work around JRuby bug.

    myronmarston committed Jan 10, 2014
  3. @myronmarston
  4. @myronmarston

    Fix 1.8.7.

    I'm not sure why, but aliasing `__send__` to `send`
    on 1.8.7 doesn't work correctly. Defining the alias
    manually does, for some reason.
    
    While we're at it, it makes more sense to define
    `__send__` as primary and `send` as secondary,
    as it's more likely users will stub `send`
    (e.g. for an `email` object).
    myronmarston committed Jan 10, 2014
  5. @myronmarston

    Allow null object verified doubles to receive private methods using `…

    …send`.
    
    This mirrors the behavior of the real object.
    myronmarston committed Jan 10, 2014
  6. @myronmarston

    Fix null_object double visibility bug.

    The error being raised had the word "private" in
    it only because the method itself had that in its
    name, but this did not indicate it was raising
    the normal "private method called" error raised
    by ruby.
    myronmarston committed Jan 10, 2014
Commits on Jan 9, 2014
  1. @myronmarston
  2. @myronmarston

    Fix indentation.

    myronmarston committed Jan 9, 2014
  3. @myronmarston

    Merge pull request #519 from rspec/lifecycle-space-fixups

    Lifecycle/space fixups
    myronmarston committed Jan 9, 2014
Commits on Jan 7, 2014
  1. @myronmarston

    Indent `private` at same level as class.

    This is our preferred convention.
    myronmarston committed Jan 7, 2014
  2. @myronmarston
  3. @myronmarston

    Remove unnecessary collection clearing.

    Since we now use a new space instance per example,
    we don't need to clear its collections when resetting.
    Before this was necessary because we kept a space instance
    that we would keep using for the lifetime of the process.
    
    Constant mutators weren't being reset idempotently, so I
    had to tweak them a bit.
    myronmarston committed Jan 6, 2014
  4. @myronmarston

    Move mock_space_spec specs into space_spec.rb

    Not sure how we wound up with two separate files, anyway.
    myronmarston committed Jan 6, 2014
  5. @myronmarston

    Simplify spec.

    rspec-mocks lacks the necessary sandboxing to safely
    define and run examples from within examples.
    rspec-core has and uses this but it's not exposed
    for use here.
    
    Instead, we can just trigger the teardown/setup
    that happens between examples.
    
    This fixes some rspec-mocks space leakage
    that was happening.
    myronmarston committed Jan 6, 2014
  6. @myronmarston

    Clean up expectation ordering.

    - It was duplicated in Proxy.
    - Makes more sense to initialize it in Space init.
    myronmarston committed Jan 6, 2014
Commits on Jan 6, 2014
  1. @myronmarston

    Add RSpec::Mocks.with_temporary_scope.

    Closes #240.
    myronmarston committed Jan 6, 2014
  2. @myronmarston
Commits on Jan 5, 2014
  1. @myronmarston
  2. @myronmarston

    Re-work spec file a bit.

    - Make it more general (it's not just about stubbing).
    - Remove unused lines.
    - Improve doc output (`include_examples` does not
      create a nested group).
    myronmarston committed Jan 3, 2014
  3. @myronmarston

    Refactor: store const mutators in mock space.

    This unifies global storage of modified things in one place.
    myronmarston committed Jan 3, 2014
  4. @myronmarston

    Having a private `pretty_print` method causes problems.

    When rspec-expectations tries to diff the object in
    a failure message, it blows up when the `pp` library
    tries to print it.
    myronmarston committed Jan 4, 2014
Commits on Jan 4, 2014
  1. @myronmarston

    Remove an unnecessary layer of indirection.

    * This should be faster (but almost certainly not
      noticably so).
    * It was odd to expose these methods off of `RSpec::Mocks`
      given that they are not intended for usage outside
      rspec-mocks.
    * We weren't getting any benefit from these except
      for not having to type `.space`.
    myronmarston committed Jan 3, 2014
  2. @myronmarston

    Move error_space.rb into space.rb

    There's no need for a separate file and there's
    going to be a bit of interaction between multiple
    spaces at various layers in a stack so having it
    in one file will make it easier to see how it relates.
    myronmarston committed Jan 3, 2014
  3. @myronmarston

    Centralize error classes in error_generator.rb.

    Also, document some of them as public since
    users may want to rescue them, or specify
    a block will raise one of these errors
    (e.g. in an rspec-mocks extension gem).
    myronmarston committed Jan 3, 2014
  4. @myronmarston
  5. @myronmarston

    Make test doubles self-destruct after the example completes.

    Test doubles are not designed to be used outside of
    the example they were created in.
    myronmarston committed Jan 2, 2014
  6. @myronmarston

    Update teardown spec.

    We're going to change how pure test doubles behave
    after teardown, so update this to focus on partial
    doubles (which will not be changed).
    myronmarston committed Jan 3, 2014
  7. @myronmarston

    Split spec into two.

    The second part of this spec was added in
    9357e4d. We are
    changing test doubles so that they self-destruct
    after being reset. Currently, `verify` also
    resets, so verifying a test double twice
    will no longer be allowed.
    myronmarston committed Jan 3, 2014
  8. @myronmarston

    Update spec to only specify the behavior we are keeping.

    We're going to change the behavior of test doubles
    that have been reset (so that they "expire" and can
    no longer be used). This spec was originally added in
    847c66d where the
    point was to address an error while resetting a test
    double (which, in turn caused that method double
    to stick around into later examples and continue to
    fail).
    myronmarston committed Jan 3, 2014
  9. @myronmarston

    Remove test we no longer need.

    The logic that required this test was removed in cd81094.
    myronmarston committed Jan 3, 2014
  10. @myronmarston

    Stop double-resetting mock proxies.

    We don't need to reset the mock proxy while verifying it.
    That'll happen later during the teardown phase.
    
    It looks like the main reason we were doing this was
    to assist with rspec-mocks testing itself; we would
    verify the middle of an example to assert a mock expectation
    failure, and a `reset` is needed so it doesn't fail again
    when rspec-core calls `verify` as well.
    
    The solution is to use spec helper methods that perform
    the reset when we verify in the middle of an example.
    
    I don't have any evidence this improves perf, but it
    seems reasonable to assume that removing an extra method
    call per example can only make it faster (however slight
    the improvement may be).
    
    Fixes #165.
    myronmarston committed Jan 3, 2014
Commits on Jan 3, 2014
  1. @myronmarston

    Merge pull request #518 from rspec/fix-registered-error-space

    Allow objects to be marshaled outside per-test lifecycle.
    myronmarston committed Jan 3, 2014
  2. @myronmarston

    Move these specs under the `RSpec::Mocks::Double` example group.

    These were defined at the top level with descriptions
    like `==` or `with`, which made no sense without the
    context of `RSpec::Mocks::Double`.
    myronmarston committed Jan 2, 2014
  3. @myronmarston
  4. @myronmarston