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

RSpec delay methods execute interaction #19

Open
HashNotAdam opened this issue Oct 30, 2023 · 1 comment
Open

RSpec delay methods execute interaction #19

HashNotAdam opened this issue Oct 30, 2023 · 1 comment

Comments

@HashNotAdam
Copy link

When using any of the RSpec helper methods for delayed jobs (allow_to_delay_run, allow_to_delay_execute, expect_to_delay_run, expect_not_to_run_delayed, expect_to_not_run_delayed, and expect_to_delay_execute), the interaction is actually run, unlike the non-delayed helper methods.

Testing this assumes that issue #18 has been resolved. Creating tests for these methods results in:

RuntimeError:
  This should never be called

Before producing a PR, I'd like to confirm that the expected behaviour is that the delay methods also stub the instance so the execute method isn't run.

@antulik
Copy link
Owner

antulik commented Nov 15, 2023

Before producing a PR, I'd like to confirm that the expected behaviour is that the delay methods also stub the instance so the execute method isn't run.

Yes, looking at the code, it stubs execution. I believe my reasoning for stubbing was to mock dependencies to isolate test.

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