Skip to content

Instantly share code, notes, and snippets.

@marcocarvalho
Created December 22, 2017 16:31
Show Gist options
  • Save marcocarvalho/3fe65f7561003c826cfbec72d11cbd45 to your computer and use it in GitHub Desktop.
Save marcocarvalho/3fe65f7561003c826cfbec72d11cbd45 to your computer and use it in GitHub Desktop.
Upgrade rspec 2.x to 3.x
# http://rspec.info/upgrading-from-rspec-2/
^(\s*)(.*?)\.stub\((.*?)\) -> \1allow(\2).to receive(\3)
^(\s*)(.*?)\.should\s*be_true -> \1expect(\2).to be_truthy
^(\s*)(.*?)\.should == -> \1expect(\2).to eq
^(\s*)(.*?)\.should_receive[\s\(]*(:\S*)\)* -> \1expect(\2).to receive(\3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment