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

Ran into this issue today, which I've reproduced approximately here: ``` ruby class Foo def self.find new end def bar 'bar' end end class Baz def qux Foo.find.bar 'qux' end...

Re: https://twitter.com/joshuap/status/722545431104753664 cc @samphippen To reproduce this bug check out my [gist](https://gist.github.com/joshuap/4561dff8af653d1f6a3862557d15c503): ``` sh git clone [email protected]:4561dff8af653d1f6a3862557d15c503.git rspec_bug cd rspec_bug bundle install bundle exec rspec bug_spec.rb ``` Example: ``` ruby...

Ran across this gist that demonstrates some thread safety issues with 3.0.0.beta2 (and 2.14, of course): https://gist.github.com/ordinaryzelig/f3a48b2456eac28bbbca Thought it would be useful for when we dig more into this.

If I stub out a method created by `alias_method` in an included module, using any_instance, the next spec to call it raises `NoMethodError`. Probably related to the fix for #1042...

Hi, most of the time, when we use the `receive` matcher on an existing object, we want do ensure, that the object also responds to this method. ``` ruby obj...

The idea is to be able to mock or stub irrelevant objects (to the given test case concerns) one wants to simply bypass in oneself code logic. So, if one...

The arg matchers are now starting to overlap with the matchers in rspec-expectations as of rspec/rspec-expectations#393. @xaviershay suggested maybe moving the common matchers into rspec-support, and I think I like...

Not a release blocker

``` ruby RSpec.describe "Using `aggregate_failures` with a negative message expectation" do it "should report only one failure but reports two", :aggregate_failures do dbl = double expect(dbl).not_to receive(:foo) dbl.foo end end...

Release Blocker

We did this previously in rspec-core in rspec/rspec-core#1905. All code that is not currently covered should be looked at, and it should be determined which of these categories it's in:...

I have a feature request similar to #794 (instance_double not matching the same class it is mocking) but I have a more specific use-case and solving for it doesn't necessary...