1
0
Fork 0
mirror of synced 2024-11-12 20:28:58 -05:00
ultimate-vim/sources_non_forked/vim-ruby/spec/syntax/methods_spec.rb
2021-06-30 12:00:07 -05:00

36 lines
904 B
Ruby
Executable file

require 'spec_helper'
describe "Syntax highlighting" do
specify "method definitions" do
str = <<~'EOF'
def foo bar
end
EOF
assert_correct_highlighting str, %w[def end], 'rubyDefine'
assert_correct_highlighting str, 'foo', 'rubyMethodName'
end
specify "method definitions named 'end'" do
assert_correct_highlighting <<~'EOF', 'end', 'rubyMethodName'
def end end
EOF
assert_correct_highlighting <<~'EOF', 'end', 'rubyMethodName'
def
end
end
EOF
end
specify "method parameters with symbol default values" do
assert_correct_highlighting <<~'EOF', ':baz', 'rubySymbol'
def foo bar=:baz
end
EOF
end
specify "unparenthesised method parameters with a required trailing keyword then semicolon" do
assert_correct_highlighting <<~'EOF', 'bar', 'rubySymbol'
def foo bar:; end
EOF
end
end