Skip to content

Instantly share code, notes, and snippets.

@manfrin
Last active December 14, 2015 05:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manfrin/5033850 to your computer and use it in GitHub Desktop.
Save manfrin/5033850 to your computer and use it in GitHub Desktop.
Rspec Snippets for Sublimetext
<snippet>
<content>
<![CDATA[FactoryGirl.create $1]]>
</content>
<tabTrigger>fg</tabTrigger>
</snippet>
Go to Tools -> New Snippet, copy these. 1 per file. Save as anything.sublime-snippet
Typing:
rspec[tab] will fill in code for a new rspec file
2nd Tabbing will move you from the Controller entry to the first Context enty
should[tab]
2nd Tabbing will move you from the Object to Expectation
its[tab]
2nd Tabbing will move you from the 'should' block to the body
fg[tab]
No 2nd tabbing, first tab allows entry of FG model.
<snippet>
<content>
<![CDATA[
it "$1" do
$0
end
]]>
</content>
<tabTrigger>its</tabTrigger>
</snippet>
<snippet>
<content>
<![CDATA[
require 'spec_helper'
describe ${1:WhatController} do
context "#${2:method_name}" do
end
$0
end
]]>
</content>
<tabTrigger>rspec</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[$1.should eq('$2')]]></content>
<tabTrigger>should</tabTrigger>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment