RSpec message expectations and verify-after-execution behavior
RSpec provides distinct mechanisms for verifying method calls on test doubles, specifically through traditional message expectations and the use of spies. While expect().to receive() sets a requirement before the action occurs, spies enable an "act first, assert later" pattern using have_received() . There is a design consideration regarding the internal sta