1
0
Fork 0
mirror of synced 2024-12-27 00:53:20 -05:00
ultimate-vim/sources_non_forked/vim-elixir/spec/syntax/defmodule_spec.rb
2022-05-19 01:31:41 +08:00

30 lines
1 KiB
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe 'Defmodule syntax' do
it 'defines `defmodule` keyword as elixirModuleDefine' do
expect(<<~EOF).to include_elixir_syntax('elixirModuleDefine', 'defmodule')
defmodule HelloPhoenix.HelloController do
EOF
end
it 'defines module name as elixirModuleDeclaration' do
str = "defmodule HelloPhoenix.HelloController do"
expect(str).to include_elixir_syntax('elixirModuleDeclaration', 'HelloPhoenix')
expect(str).to include_elixir_syntax('elixirModuleDeclaration', '\.')
expect(str).to include_elixir_syntax('elixirModuleDeclaration', 'HelloController')
end
it 'does not define module name as elixirAlias' do
expect(<<~EOF).not_to include_elixir_syntax('elixirAlias', 'HelloPhoenix.HelloController')
defmodule HelloPhoenix.HelloController do
EOF
end
it 'defines `do` keyword as elixirBlock' do
expect(<<~EOF).to include_elixir_syntax('elixirBlock', 'do')
defmodule HelloPhoenix.HelloController do
EOF
end
end