specky/snippets/rspec.snippets
branchvim-stuff
changeset 19 763cef799c74
parent 12 a9f1ce3766d1
equal deleted inserted replaced
18:bf8f3c788cad 19:763cef799c74
    54 	.with( ${1:args} )${2}
    54 	.with( ${1:args} )${2}
    55 snippet con
    55 snippet con
    56 	context "${1:context}" do
    56 	context "${1:context}" do
    57 		${2}
    57 		${2}
    58 	end
    58 	end
       
    59 # this is the 'old' mock syntax (rspec 1.x)
       
    60 # use 'double' for rspec 2.x
    59 snippet mock
    61 snippet mock
    60 	${1:var} = mock( "${2:mock_name}"${3:, :null_object => true} )
    62 	${1:var} = mock( "${2:mock_name}"${3:, :null_object => true} )
       
    63 	${4}
       
    64 snippet dou
       
    65 	${1:var} = double( "${2:double_name}" )${3:.as_null_object}
    61 	${4}
    66 	${4}
    62 snippet st
    67 snippet st
    63 	stub!( :${1:expectation} ).with( ${2:args} ).and_return( ${3} )
    68 	stub!( :${1:expectation} ).with( ${2:args} ).and_return( ${3} )
    64 snippet bef Before each test
    69 snippet bef Before each test
    65 	before( :each ) do
    70 	before( :each ) do