forked from kaichen/vim-snipmate-ruby-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruby-rspec.snippets
61 lines (53 loc) · 851 Bytes
/
ruby-rspec.snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# rspec
snippet spechelper
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')${1}
# describe
snippet des
describe ${1:description}" do
${2}
end
snippet desc
describe ${1:class} do
before do
${2}
end
end
snippet descd
describe ${1:class}, "${2:description}" do
before do
${3}
end
end
snippet desd
describe "${1:description}" do
before do
${2}
end
end
# before & after
snippet before-
before(:${1:each}) do
${2}
end
snippet after-
after(:${1:each}) do
${2}
end
# it should
snippet it
it "should ${1:description}" do
${2}
end
snippet itsh
it "should ${1:description}" do
${2:model}.should ${3}
end
snippet itshbe
it "should ${1:description}" do
${2:model}.should be_${3}
end
# matchers
snippet sheq
${1:targe}.should == ${2}
snippet shbe
${1:target}.should be_${2:result}