From 0f712a1423983bb3ad6fcafef4d86c9f66bccc04 Mon Sep 17 00:00:00 2001 From: majjoha Date: Sat, 26 Jul 2014 17:36:16 -0400 Subject: [PATCH] Move the RSpec snippets from rails.snippets to ruby.snippets. --- snippets/rails.snippets | 50 -------------------------------------- snippets/ruby.snippets | 53 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 50 deletions(-) diff --git a/snippets/rails.snippets b/snippets/rails.snippets index 44b1598..d8fe2be 100644 --- a/snippets/rails.snippets +++ b/snippets/rails.snippets @@ -411,56 +411,6 @@ snippet tctss ########################## # Rspec snippets # ########################## -snippet desc - describe ${1:`substitute(substitute(vim_snippets#Filename(), '_spec$', '', ''), '\(_\|^\)\(.\)', '\u\2', 'g')`} do - ${0} - end -snippet descm - describe '${1:#method}' do - ${0:pending 'Not implemented'} - end -snippet cont - context '${1:message}' do - ${0} - end -snippet bef - before :${1:each} do - ${0} - end -snippet aft - after :${1:each} do - ${0} - end -snippet let - let(:${1:object}) { ${0} } -snippet let! - let!(:${1:object}) { ${0} } -snippet subj - subject { ${0} } -snippet s. - subject.${0:method} -snippet spec - specify { subject.${0} } -snippet exp - expect(${1:object}).to ${0} -snippet expb - expect { ${1:object} }.to ${0} -snippet experr - expect { ${1:object} }.to raise_error ${2:StandardError}, /${0:message_regex}/ -snippet shared - shared_examples ${0:'shared examples name'} -snippet ibl - it_behaves_like ${0:'shared examples name'} -snippet it - it '${1:spec_name}' do - ${0} - end -snippet its - its(:${1:method}) { should ${0} } -snippet is - it { should ${0} } -snippet isn - it { should_not ${0} } #ShouldaMatchers#ActionController snippet isfp it { should filter_param :${0:key} } diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index af75bd0..fd4172c 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -656,3 +656,56 @@ snippet msend must_send [ ${1:what}, :${2:method}, ${3:args} ] snippet mthrow -> { throw :${1:error} }.must_throw :${2:error} +########################## +# Rspec snippets # +########################## +snippet desc + describe ${1:`substitute(substitute(vim_snippets#Filename(), '_spec$', '', ''), '\(_\|^\)\(.\)', '\u\2', 'g')`} do + ${0} + end +snippet descm + describe '${1:#method}' do + ${0:pending 'Not implemented'} + end +snippet cont + context '${1:message}' do + ${0} + end +snippet bef + before :${1:each} do + ${0} + end +snippet aft + after :${1:each} do + ${0} + end +snippet let + let(:${1:object}) { ${0} } +snippet let! + let!(:${1:object}) { ${0} } +snippet subj + subject { ${0} } +snippet s. + subject.${0:method} +snippet spec + specify { subject.${0} } +snippet exp + expect(${1:object}).to ${0} +snippet expb + expect { ${1:object} }.to ${0} +snippet experr + expect { ${1:object} }.to raise_error ${2:StandardError}, /${0:message_regex}/ +snippet shared + shared_examples ${0:'shared examples name'} +snippet ibl + it_behaves_like ${0:'shared examples name'} +snippet it + it '${1:spec_name}' do + ${0} + end +snippet its + its(:${1:method}) { should ${0} } +snippet is + it { should ${0} } +snippet isn + it { should_not ${0} }