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

It's a short leap to guess that `class_spy` and `class_double` exist because `double -> spy`, however it would still be nice to have official cucumber documentation for this.

small
good-first-issue
hacktoberfest

When mocking a method, `object.method(:mocked_method).parameters` no longer reflects the original method. I wonder if we can improve that? It may not be practical.

I'm not sure if this is a bug or not, I found out the `stub_const` doesn't work with constant inside `class > NameError: > wrong constant name HelloWorld.singleton_class > >...

This allows us to override methods which are present on a parent and subclass with `any_instance_of`. Closes #1077, /cc @samphippen

Currently, RSpec mocks are disallowed by the [Sorbet](https://sorbet.org) runtime system. A [relevant design justification](https://stackoverflow.com/questions/56742572/how-to-use-sorbet-type-checking-with-rspec-mocks) is: > Mocha mocks (stub in tests) will not pass any type checks by default. This...

### Version 3.11.2 issue with kwargs Today our CI started failing with the new version of rspec-mocks released. It seems that mocking the kwargs no longer has the same behavior...

### Subject of the issue Message expectation with block arguments for keyword argument method behaves differently for `ruby 3.2.0preview2`. The code snippets works fine with ruby `3.0.3` and ruby `3.1.1`....

### Subject of the issue We have a custom matcher that matches "`as_json`-able" objects. ```rb RSpec::Matchers.define :as_json do |expected| def actual = super.as_json match { |actual| values_match? expected, actual }...

According to https://github.com/rspec/rspec-mocks/blob/4-0-dev/Changelog.md, only those two deprecation warnings are needed. This is purposed to be released as version 3.99. Similar PRs for Expectations will follow. Sibling PRs: - https://github.com/rspec/rspec-core/pull/2880 -...

### Subject of the issue When delegating using `**kwargs`, the spec fails when passed no keyword arguments in 2.7 (no issues with 3.0). ### Your environment * Ruby version: 2.7...