summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2013-09-17 02:43:05 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2013-09-17 02:43:05 +0200
commit9d92f103757d629193e9ec2d4669eb1094b23669 (patch)
tree973bc8b33579aa978019a1e736d99e9ba21bc2ab
parentfc0b11afe100733fc960f1ec47c32a581b5b9b99 (diff)
downloadvim-polyglot-1.3.1.tar.gz
vim-polyglot-1.3.1.zip
Use my own fork of rspec.vim to properly detect spec filev1.3.1
-rw-r--r--after/ftdetect/rspec.vim2
-rw-r--r--after/syntax/rspec.vim32
-rwxr-xr-xbuild2
-rw-r--r--syntax/vim-rspec.vim21
4 files changed, 35 insertions, 22 deletions
diff --git a/after/ftdetect/rspec.vim b/after/ftdetect/rspec.vim
new file mode 100644
index 00000000..ce43f581
--- /dev/null
+++ b/after/ftdetect/rspec.vim
@@ -0,0 +1,2 @@
+autocmd BufReadPost,BufNewFile *_spec.rb set syntax=rspec
+autocmd BufReadPost,BufNewFile *_spec.rb setlocal commentstring=#\ %s
diff --git a/after/syntax/rspec.vim b/after/syntax/rspec.vim
new file mode 100644
index 00000000..390f6d10
--- /dev/null
+++ b/after/syntax/rspec.vim
@@ -0,0 +1,32 @@
+"
+" An rspec syntax file
+" Originally from http://www.vim.org/scripts/script.php?script_id=2286
+"
+"
+
+runtime! syntax/ruby.vim
+unlet! b:current_syntax
+
+syntax keyword rspecGroupMethods context describe example it its let it_should_behave_like shared_examples_for subject it_behaves_like pending specify When Then Given Invariant feature scenario given
+highlight link rspecGroupMethods Type
+
+syntax keyword rspecBeforeAndAfter after after_suite_parts append_after append_before before before_suite_parts prepend_after prepend_before around
+highlight link rspecBeforeAndAfter Statement
+
+syntax keyword rspecMocks double mock stub stub_chain
+highlight link rspecMocks Constant
+
+syntax keyword rspecMockMethods and_raise and_return and_throw and_yield build_child called_max_times expected_args invoke matches
+highlight link rspecMockMethods Function
+
+syntax keyword rspecKeywords should should_not should_not_receive should_receive
+highlight link rspecKeywords Constant
+
+syntax keyword rspecMatchers be change eql equal exist expect have have_at_least have_at_most have_exactly include match matcher raise_error raise_exception respond_to satisfy throw_symbol to to_not not_to when wrap_expectation
+syntax match rspecMatchers /\<\(be\|have\)_\w\+\>/
+highlight link rspecMatchers Function
+
+syntax keyword rspecMessageExpectation advise any_args any_number_of_times anything at_least at_most exactly expected_messages_received generate_error hash_including hash_not_including ignoring_args instance_of matches_at_least_count matches_at_most_count matches_exact_count matches_name_but_not_args negative_expectation_for never no_args once ordered similar_messages times twice verify_messages_received with
+highlight link rspecMessageExpectation Function
+
+let b:current_syntax = 'rspec'
diff --git a/build b/build
index 17e74321..704e9858 100755
--- a/build
+++ b/build
@@ -95,7 +95,7 @@ PACKS="
puppet:ajf/puppet-vim
protobuf:uarun/vim-protobuf
python:vim-scripts/python.vim--Vasiliev
- rspec:skwp/vim-rspec
+ rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby
sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala
diff --git a/syntax/vim-rspec.vim b/syntax/vim-rspec.vim
deleted file mode 100644
index 57adeecf..00000000
--- a/syntax/vim-rspec.vim
+++ /dev/null
@@ -1,21 +0,0 @@
-syntax match rspecHeader /^*.*/
-syntax match rspecTitle /^\[.\+/
-syntax match rspecOk /^+.\+/
-syntax match rspecOk /PASS.\+/
-syntax match rspecError /^-.\+/
-syntax match rspecError /FAIL.\+/
-syntax match rspecError /^|.\+/
-syntax match rspecErrorDetail /^ \w.\+/
-syntax match rspecErrorURL /^ \/.\+/
-syntax match rspecNotImplemented /^#.\+/
-syntax match rspecCode /^ \d\+:/
-syntax match rspecNotImplemented /Example disabled.*/
-
-highlight link rspecHeader Identifier
-highlight link rspecTitle Identifier
-highlight link rspecOk Statement
-highlight link rspecError Error
-highlight link rspecErrorDetail Constant
-highlight link rspecErrorURL PreProc
-highlight link rspecNotImplemented Todo
-highlight link rspecCode Type