Last active
December 14, 2015 05:18
-
-
Save manfrin/5033850 to your computer and use it in GitHub Desktop.
Rspec Snippets for Sublimetext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content> | |
<![CDATA[FactoryGirl.create $1]]> | |
</content> | |
<tabTrigger>fg</tabTrigger> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content> | |
<![CDATA[ | |
it "$1" do | |
$0 | |
end | |
]]> | |
</content> | |
<tabTrigger>its</tabTrigger> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content> | |
<![CDATA[ | |
require 'spec_helper' | |
describe ${1:WhatController} do | |
context "#${2:method_name}" do | |
end | |
$0 | |
end | |
]]> | |
</content> | |
<tabTrigger>rspec</tabTrigger> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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