Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
291 lines (217 sloc) 4.9 KB
snippet aft
after(${1::each}) do
${2}
end
snippet annot
any_number_of_times
snippet anr
and_return(${1:value})
snippet anra
and_raise(${1:exception})
snippet anrb
and_return { ${1} }
snippet ant
and_throw(${1:sym})
snippet any
and_yield(${1:values})
snippet atl
at_least(${1:n}).times
snippet atm
at_most(${1:n}).times
snippet bef
before(${1::each}) do
${2}
end
snippet conn
controller_name :${1:controller}
snippet des
describe "${1:subject}" do
${2}
end
snippet desc
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe ${1:controller} do
${2}
end
snippet desrc
describe ${1:controller}, "${2:GET|POST|PUT|DELETE} ${3:/some/path}${4}" do
${5}
end
snippet dest
describe ${1:Type} do
${2}
end
snippet dests
describe ${1:Type}, "${2:description}" do
${3}
end
snippet ex
exactly(${1:n}).times
snippet it
it '${1}' do
${2}
end
snippet its
it "should ${1:do something}" do${2}
snippet mat
class ${1:ReverseTo}
def initialize(${2:param})
@$2 = $2
end
def matches?(actual)
@actual = actual
# Satisfy expectation here. Return false or raise an error if it's not met.
${3:@actual.reverse.should == @$2}
true
end
def failure_message
"expected #{@actual.inspect} to ${4} #{@$2.inspect}, but it didn't"
end
def negative_failure_message
"expected #{@actual.inspect} not to ${5} #{@$2.inspect}, but it did"
end
end
def ${6:reverse_to}(${7:expected})
${8}.new($7)
end
snippet mm
mock_model(${1:model})${2}
snippet moc
${1:var} = mock("${2:mock_name}"${3:, :null_object => true})
${4}
snippet mocw
Spec::Runner.configure do |config|
config.mock_with :${1:mocha|flexmock|rr}
end
snippet on
once
snippet resh
require File.dirname(__FILE__) + '/../spec_helper'
snippet sh
${1:target}.should == ${2:value}
${3}
snippet shb
${1:target}.should be(${2:result})
${3}
snippet shbc
${1:target}.should be_close(${2:result}, ${3:tolerance})
${4}
snippet shbio
${1:target}.should be_instance_of(${2:class})
${3}
snippet shbko
${1:target}.should be_a_kind_of(${2:class})
${3}
snippet shbr
response.should be_redirect
${1}
snippet shbs
response.should be_success
${1}
snippet shc
lambda do
${1}
end.should change(${2:target}, :${3:method}).from(${4:old_value}).to(${5:new_value}).by(${6:change})
snippet shdm
${1:target}.should match(/${2:regexp}/)
${3}
snippet she
${1:target}.should eql(${2:value})
${3}
snippet sheq
${1:target}.should equal(${2:value})
${3}
snippet shh
${1:target}.should have(${2:num}).${3:things}
${4}
snippet shhal
${1:target}.should have_at_least(${2:num}).${3:things}
${4}
snippet shham
${1:target}.should have_at_most(${2:num}).${3:things}
${4}
snippet shhr
${1:target}.should have(${2:n}).records
${3}
snippet shn
${1:target}.should_not == ${2:value}
${3}
snippet shnb
${1:target}.should_not be(${2:result})
${3}
snippet shnbc
${1:target}.should_not be_close(${2:result}, ${3:tolerance})
${4}
snippet shnbio
${1:target}.should_not be_instance_of(${2:klass})
${3}
snippet shnbko
${1:target}.should_not be_a_kind_of(${2:klass})
${3}
snippet shnbr
response.should_not be_redirect
${1}
snippet shnbs
response.should_not be_success
${1}
snippet shnc
lambda do
${1}
end.should_not change(${2:target}, :${3:method})
snippet shne
${1:target}.should_not eql(${2:value})
${3}
snippet shneq
${1:target}.should_not equal(${2:value})
${3}
snippet shnm
${1:target}.should_not match(/${2:regexp}/)
${3}
snippet shnp
${1:target}.should_not be_${2:predicate}
snippet shnr
${1:mock}.should_not_receive(:${2:message})${3}
${4}
snippet shnre
${1:target}.should_not raise_error(${2:error})
${3}
snippet shnredt
response.should_not redirect_to(${1:url})
${2}
snippet shnrt
${1:target}.should_not respond_to(:${2:sym})
${3}
snippet shns
${1:target}.should_not satisfy { |${2:obj}| ${3} }
${4}
snippet shnt
lambda { ${1} }.should_not throw_symbol(:${2:symbol})
${3}
snippet shp
${1:target}.should be_${2:predicate}
snippet shr
${1:mock}.should_receive(:${2:message})${3}
${4}
snippet shre
${1:target}.should raise_error(${2:error})
${3}
snippet shredt
response.should redirect_to(${1:url})
${2}
snippet shrt
${1:target}.should respond_to(:${2:sym})
${3}
snippet shs
${1:target}.should satisfy { |${2:obj}| ${3} }
${4}
snippet sht
${1:target}.should throw_symble(:${2:symbol})
${3}
snippet shtemp
response.should render_template(:${1:template})
${2}
snippet tw
twice
snippet wia
with(${1:args})
${2}