rspec / rspec-mocks

RSpec's 'test double' framework, with support for stubbing and mocking
https://rspec.info
MIT License
1.16k stars 357 forks source link

replacing lambdas with procs #1487

Closed C-Miles closed 1 year ago

C-Miles commented 1 year ago

We tried using .and_invoke and found the lambdas were being called with an argument.

JonRowe commented 1 year ago

If you pass an argument to your method calls, then lambdas or procs passed to and_invoke are called with those arguments, so this example is correct, as there are no arguments passed.

C-Miles commented 1 year ago

@JonRowe right on! that makes sense, thank you!