1
0
Fork 0
mirror of synced 2024-11-15 05:28:57 -05:00
ultimate-vim/sources_non_forked/vim-elixir/spec/indent/comment_spec.rb
2022-05-19 01:31:41 +08:00

56 lines
978 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe 'Indenting *after* comments' do
i <<~EOF
# do
IO.puts :test
EOF
i <<~EOF
defmodule Foo do
def run do
list =
File.read!("/path/to/file")
|> String.split()
# now start a new line
# used to start here
# but now starts here
end
end
EOF
i <<~EOF
defmodule Foo do
def run(task) when task in [:t1, :t2] do
end
# now starts a new line
# use to start here
# but now starts here
end
EOF
i <<~EOF
receive do
{{:lock_ready, ^key}, ^pid} ->
after
# NOTE: @jbodah 2017-03-28: we should do some math to adjust the timeout
timeout ->
{:error, :timed_out_waiting_for_lock}
end
EOF
it "bulk indenting comments" do
expect(<<~EOF).to be_elixir_indentation
defmodule Test do
# SELECT *
# FROM table
# WHERE column = 123
# AND another_column = 456
end
EOF
end
end