1
0
Fork 0
mirror of synced 2024-11-18 06:55:33 -05:00
ultimate-vim/sources_non_forked/vim-elixir/spec/folding/basic_spec.rb

97 lines
1.3 KiB
Ruby
Raw Normal View History

2022-05-18 13:31:41 -04:00
# frozen_string_literal: true
require 'spec_helper'
describe 'Basic folding' do
def self.fold(content)
it("properly folds \n#{content}") do
expect(content).to fold_lines
end
end
fold <<~EOF
defmodule M do # fold
end # fold
"not in fold"
EOF
fold <<~EOF
defmodule M do # fold
def some_func do # fold
end # fold
end # fold
"not in fold"
EOF
fold <<~EOF
defmodule M do
def some_func do # fold
end # fold
end
"not in fold"
EOF
fold <<~EOF
if true do # fold
end # fold
"not in fold"
EOF
fold <<~EOF
if true do # fold
nil # fold
else # fold
nil # fold
end # fold
"not in fold"
EOF
fold <<~EOF
defmodule M do
def some_func do
[ # fold
:hello, # fold
:world # fold
] # fold
:hello_world
end
end
EOF
fold <<~EOF
defmodule M do
def some_func do
{ # fold
:hello, # fold
:world # fold
} # fold
:hello_world
end
end
EOF
fold <<~EOF
defmodule M do
def some_func do
%{ # fold
hello: "a", # fold
world: "b" # fold
} # fold
:hello_world
end
end
EOF
fold <<~EOF
defmodule M do
def some_func do
%User{ # fold
hello: "a", # fold
world: "b" # fold
} # fold
:hello_world
end
end
EOF
end