Extract ExpectsMethod.install_mock_method()
Replace 'if' with inline 'unless'.