Skip to content

Commit 610834f

Browse files
committed
Improve RSpec highlighting
1 parent 84d7c0a commit 610834f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

autoload/rails.vim

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,14 +3955,23 @@ function! rails#ruby_syntax() abort
39553955
endif
39563956

39573957
if buffer.type_name('spec')
3958-
syn keyword rubyTestMacro describe feature containedin=rubyKeywordAsMethod
3959-
syn keyword rubyTestMacro context it its specify shared_context shared_examples shared_examples_for shared_context include_examples include_context it_should_behave_like it_behaves_like before after around subject xit scenario background given
3960-
syn match rubyTestMacro '\<let\>!\='
3958+
syn match rubyTestHelper '\<subject\>'
3959+
syn match rubyTestMacro '\<\%(let\|given\)\>!\='
3960+
syn match rubyTestMacro '\<subject\>!\=\ze\s*\%([({&:]\|do\>\)'
3961+
syn keyword rubyTestMacro before after around background setup teardown
3962+
syn keyword rubyTestMacro context describe feature shared_context shared_examples shared_examples_for containedin=rubyKeywordAsMethod
3963+
syn keyword rubyTestMacro it example specify scenario include_examples include_context it_should_behave_like it_behaves_like
3964+
syn keyword rubyComment xcontext xdescribe xfeature containedin=rubyKeywordAsMethod
3965+
syn keyword rubyComment xit xexample xspecify xscenario
39613966
endif
39623967
if buffer.type_name('spec', 'cucumber')
3963-
syn keyword rubyAssertion pending skip expect expect_any_instance_of allow allow_any_instance_of
3968+
syn keyword rubyAssertion pending skip expect is_expected expect_any_instance_of allow allow_any_instance_of
39643969
syn keyword rubyTestHelper double instance_double class_double object_double described_class
39653970
endif
3971+
if buffer.type_name('spec-controller')
3972+
syn keyword rubyTestMacro render_views
3973+
syn keyword rubyTestHelper assigns
3974+
endif
39663975
if buffer.type_name('spec-helper')
39673976
syn keyword rubyTestAction assign
39683977
syn keyword rubyTestHelper helper

0 commit comments

Comments
 (0)