rspec-mocks icon indicating copy to clipboard operation
rspec-mocks copied to clipboard

RSpec's 'test double' framework, with support for stubbing and mocking

Results 71 rspec-mocks issues
Sort by recently updated
recently updated
newest added

This fix https://github.com/rspec/rspec-mocks/issues/1568. Stubbed classes are excluded from parent subclasses after each spec. The original issue : ``` begin require "bundler/inline" rescue LoadError => e $stderr.puts "Bundler version 1.10 or...

The following spec is green: ``` require 'rspec' RSpec.describe 'too nice spy' do example do spy_obj = spy('spy Object') expect(spy_obj).to have_receivedddddd(:foo) # passes end end ``` It took me quite...

### Subject of the issue When using an `instance_double` of a class that defines an instance method that takes keyword arguments, then using `allow` or `expect` to stub that method...

### Subject of the issue When `stub_const` is used with a class that is a subclass of another, the class is still listed in subclasses of this parent after each...

### Subject of the issue According to the [documentation](https://rspec.info/documentation/3.6/rspec-mocks/RSpec/Mocks/MessageExpectation.html) methods, at_least and at_most can be chained to have range check: method is called between N and M times. (at least...

### Subject of the issue The error "`stack level too deep`" occurs when stubbing `:is_a?` with `allow_any_instance_of`. ### Your environment * Ruby version: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux] *...

### Subject of the issue If you rspec stubs to test whether a class method, which accepts both positional and keyword arguments, is called with a positional argument, then `RSpec::Mocks::Proxy`...

### hash_including does not duck-type `a_hash_including` from rspec-expectations (via the underlying `include` matcher) supports matching expected hashes against hash-like things (so long as they implement `#to_hash`). However, `hash_including` argument matcher...

### Subject of the issue When preparing for ruby 3, I want the following deprecation warnings to be thrown when using mocks, so that I can update the code: ```...

### Subject of the issue When using `stub_const`, it does not reset `Object.const_source_location` after example finished. ### Your environment * Ruby version: 2.7.5, 3.2.2 * rspec-mocks version: 3.12.6 ### Steps...