Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubbing a base method, will erroneously stub a child method that overrides it when that child method is in a nested block #2563

Closed
jcavalieri opened this issue Sep 11, 2018 · 1 comment

Comments

@jcavalieri
Copy link

Subject of the issue

Stubbing a base method, will erroneously stub a child method that overrides it when that child method is in a nested call in a block.

Your environment

  • Ruby version: ruby 2.4.4
  • rspec-core version: 3.8.0

Steps to reproduce

Working demo here:
https://github.com/jcavalieri/rspec_issue

Running rspec ./program_spec.rb shows the failing test that should succeed

Expected behavior

Only the base implementation of the method foo should be stubbed.

Actual behavior

The base implementation of foo is stubbed, however, the child implementation of foo when in a nested block is also being stubbed.

@JonRowe
Copy link
Member

JonRowe commented Sep 12, 2018

Closing as this isn't an rspec-core issue. Will reopen on rspec-mocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants