Search:
^(\s*)(.*?).stub\((.*?)\)\.
Replace:
$1expect($2).to receive($3).
Search:
^(\s*)(.*?)\.any_instance\.should_receive(.*)
Replace:
$1expect_any_instance_of($2).to receive$3
Search:
^(\s*)(.*?)\.any_instance\.stub(.*)
Replace:
$1allow_any_instance_of($2).to receive_messages$3
Search:
^(\s*)(.*?)\.any_instance\.should_not_receive(.*)
Replace:
$1expect_any_instance_of($2).not_to receive$3
Search:
^(\s*)(.*?)\.should_not_receive(.*)
Replace:
$1expect($2).not_to receive$3