active_interaction-extras icon indicating copy to clipboard operation
active_interaction-extras copied to clipboard

RSpec delay methods execute interaction

Open HashNotAdam opened this issue 2 years ago • 1 comments

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.

HashNotAdam avatar Oct 30 '23 03:10 HashNotAdam

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.

antulik avatar Nov 15 '23 02:11 antulik