gems rspec-mocks 3.0.0.beta2

latest releases: 3.13.2, 3.13.1, 3.13.0...
11 years ago

3.0.0.beta2 / 2014-02-17

full changelog

Breaking Changes for 3.0.0:

  • Rename RSpec::Mocks::Mock to RSpec::Mocks::Double. (Myron Marston)
  • Change how to integrate rspec-mocks in other test frameworks. You now
    need to include RSpec::Mocks::ExampleMethods in your test context.
    (Myron Marston)
  • Prevent RSpec mocks' doubles and partial doubles from being used outside of
    the per-test lifecycle (e.g. from a before(:all) hook). (Sam Phippen)
  • Remove the host argument of RSpec::Mocks.setup. Instead
    RSpec::Mocks::ExampleMethods should be included directly in the scope where
    RSpec's mocking capabilities are used. (Sam Phippen)
  • Make test doubles raise errors if you attempt to use them after they
    get reset, to help surface issues when you accidentally retain
    references to test doubles and attempt to reuse them in another
    example. (Myron Marston)
  • Remove support for and_return { value } and and_return without arguments. (Yuji Nakayama)

Enhancements:

  • Add receive_message_chain which provides the functionality of the old
    stub_chain for the new allow/expect syntax. Use it like so: allow(...).to receive_message_chain(:foo, :bar, :bazz). (Sam Phippen).
  • Change argument matchers to use === as their primary matching
    protocol, since their semantics mirror that of a case or rescue statement
    (which uses === for matching). (Myron Marston)
  • Add RSpec::Mocks.with_temporary_scope, which allows you to create
    temporary rspec-mocks scopes in arbitrary places (such as a
    before(:all) hook). (Myron Marston)
  • Support keyword arguments when checking arity with verifying doubles.
    (Xavier Shay)

Bug Fixes:

  • Fix regression in 3.0.0.beta1 that caused double("string_name" => :value)
    to stop working. (Xavier Shay)
  • Fix the way rspec-mocks and rspec-core interact so that if users
    define a let with the same name as one of the methods
    from RSpec::Mocks::ArgumentMatchers, the user's let takes
    precedence. (Michi Huber, Myron Marston)
  • Fix verified doubles so that their methods match the visibility
    (public, protected or private) of the interface they verify
    against. (Myron Marston)
  • Fix verified null object doubles so that they do not wrongly
    report that they respond to anything. They only respond to methods
    available on the interface they verify against. (Myron Marston)
  • Fix deprecation warning for use of old :should syntax w/o explicit
    config so that it no longer is silenced by an extension gem such
    as rspec-rails when it calls config.add_stub_and_should_receive_to.
    (Sam Phippen)
  • Fix expect syntax so that it does not wrongly emit a "You're
    overriding a previous implementation for this stub" warning when
    you are not actually doing that. (Myron Marston)
  • Fix any_instance.unstub when used on sub classes for whom the super
    class has had any_instance.stub invoked on. (Jon Rowe)
  • Fix regression in stub_chain/receive_message_chain that caused
    it to raise an ArgumentError when passing args to the stubbed
    methods. (Sam Phippen)
  • Correct stub of undefined parent modules all the way down when stubbing a
    nested constant. (Xavier Shay)
  • Raise VerifyingDoubleNotDefinedError when a constant is not defined for
    a verifying class double. (Maurício Linhares)
  • Remove Double#to_str, which caused confusing raise some_double
    behavior. (Maurício Linhares)

Don't miss a new rspec-mocks release

NewReleases is sending notifications on new releases.