Skip to content

Instantly share code, notes, and snippets.

@traviskroberts
Created June 30, 2015 17:23
Show Gist options
  • Save traviskroberts/0161d9bf335584a7d46f to your computer and use it in GitHub Desktop.
Save traviskroberts/0161d9bf335584a7d46f to your computer and use it in GitHub Desktop.
RSpec 3 Atom snippets
'.source.ruby':
'allow(object).to receive(:method) { return_value }':
'prefix': 'arr'
'body': 'allow(${1:object}).to receive(:${2:method}) { ${3:value} }'
'allow(object).to receive(:method)':
'prefix': 'ar'
'body': 'allow(${1:object}).to receive(:${2:method})'
'allow(object).to receive_messages(method: value)':
'prefix': 'arm'
'body': 'allow(${1:object}).to receive_messages(${2:method})'
'allow(object).to receive_message_chain(methods) { return_value }':
'prefix': 'arc'
'body': 'allow(${1:object}).to receive_message_chain(${2:methods}) { ${3:value} }'
'before :each':
'prefix': 'be'
'body': 'before do\n $0\nend'
'context':
'prefix': 'con'
'body': 'context "${1:context}" do\n $0\nend'
'describe (String)':
'prefix': 'des'
'body': 'describe "${1:subject}" do\n $0\nend'
'expect':
'prefix': 'exp'
'body': 'expect(${1:subject}).${2:not_}to ${4:eq}(${5:object})'
'feature':
'prefix': 'fea'
'body': 'feature "${1:subject}" do\n $0\nend'
'it (does something)':
'prefix': 'it'
'body': 'it "${1:does something}" do\n $0\nend'
'let':
'prefix': 'let'
'body': 'let(:${1:instance}) { $0 }'
'let!':
'prefix': 'letb'
'body': 'let!(:${1:instance}) { $0 }'
'scenario':
'prefix': 'sce'
'body': 'scenario "${1:subject}" do\n $0\nend'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment