mirror of
https://github.com/amix/vimrc
synced 2025-06-17 10:55:00 +08:00
Updated plugins
This commit is contained in:
@ -1,10 +1,6 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Indenting" do
|
||||
after :each do
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
end
|
||||
|
||||
specify "indented blocks with expression style" do
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
|
||||
@ -103,6 +99,7 @@ describe "Indenting" do
|
||||
end
|
||||
|
||||
specify "blocks with multiline parameters" do
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
assert_correct_indenting <<~EOF
|
||||
def foo
|
||||
opts.on('--coordinator host=HOST[,port=PORT]',
|
||||
|
@ -57,6 +57,7 @@ describe "Indenting" do
|
||||
end
|
||||
|
||||
specify "continuations after round braces" do
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
assert_correct_indenting <<~EOF
|
||||
opts.on('--coordinator host=HOST[,port=PORT]',
|
||||
'Specify the HOST and the PORT of the coordinator') do |str|
|
||||
@ -67,10 +68,6 @@ describe "Indenting" do
|
||||
end
|
||||
|
||||
describe "assignments" do
|
||||
after :each do
|
||||
vim.command 'let g:ruby_indent_assignment_style = "hanging"'
|
||||
end
|
||||
|
||||
specify "continuations after assignment" do
|
||||
assert_correct_indenting <<~EOF
|
||||
variable =
|
||||
|
@ -0,0 +1,78 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'Indenting' do
|
||||
|
||||
specify 'method args' do
|
||||
assert_correct_indenting <<~EOF
|
||||
render('product/show',
|
||||
product: product,
|
||||
on_sale: true,
|
||||
)
|
||||
EOF
|
||||
|
||||
vim.command 'let g:ruby_indent_hanging_elements = 0'
|
||||
|
||||
assert_correct_indenting <<~EOF
|
||||
render('product/show',
|
||||
product: product,
|
||||
on_sale: true,
|
||||
)
|
||||
EOF
|
||||
end
|
||||
|
||||
specify 'method args with block' do
|
||||
assert_correct_indenting <<~EOF
|
||||
opts.on('--coordinator host=HOST[,port=PORT]',
|
||||
'Specify the HOST and the PORT of the coordinator') do |str|
|
||||
h = sub_opts_to_hash(str)
|
||||
puts h
|
||||
end
|
||||
EOF
|
||||
|
||||
vim.command 'let g:ruby_indent_hanging_elements = 0'
|
||||
|
||||
assert_correct_indenting <<~EOF
|
||||
opts.on('--coordinator host=HOST[,port=PORT]',
|
||||
'Specify the HOST and the PORT of the coordinator') do |str|
|
||||
h = sub_opts_to_hash(str)
|
||||
puts h
|
||||
end
|
||||
EOF
|
||||
end
|
||||
|
||||
specify 'arrays' do
|
||||
assert_correct_indenting <<~EOF
|
||||
x = [1,
|
||||
2,
|
||||
3,
|
||||
]
|
||||
EOF
|
||||
|
||||
vim.command 'let g:ruby_indent_hanging_elements = 0'
|
||||
|
||||
assert_correct_indenting <<~EOF
|
||||
x = [1,
|
||||
2,
|
||||
3,
|
||||
]
|
||||
EOF
|
||||
end
|
||||
|
||||
specify 'hashes' do
|
||||
assert_correct_indenting <<~EOF
|
||||
x = { a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
}
|
||||
EOF
|
||||
|
||||
vim.command 'let g:ruby_indent_hanging_elements = 0'
|
||||
|
||||
assert_correct_indenting <<~EOF
|
||||
x = { a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
}
|
||||
EOF
|
||||
end
|
||||
end
|
@ -1,10 +1,6 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "Indenting" do
|
||||
after :each do
|
||||
vim.command 'let g:ruby_indent_access_modifier_style = "normal"'
|
||||
end
|
||||
|
||||
specify "default indented access modifiers" do
|
||||
assert_correct_indenting <<~EOF
|
||||
class OuterClass
|
||||
|
@ -20,6 +20,7 @@ describe "Indenting" do
|
||||
}
|
||||
EOF
|
||||
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
assert_correct_indenting <<~EOF
|
||||
var.
|
||||
func1(:param => 'value') {
|
||||
@ -40,6 +41,7 @@ describe "Indenting" do
|
||||
}
|
||||
EOF
|
||||
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
assert_correct_indenting <<~EOF
|
||||
foo,
|
||||
bar = {
|
||||
@ -53,6 +55,7 @@ describe "Indenting" do
|
||||
end
|
||||
|
||||
specify "nested blocks with a continuation and function call inbetween" do
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
assert_correct_indenting <<~EOF
|
||||
var.
|
||||
func1(:param => 'value') {
|
||||
|
@ -20,6 +20,7 @@ describe "Indenting" do
|
||||
end
|
||||
|
||||
specify "splats with blocks in assignment" do
|
||||
vim.command 'let g:ruby_indent_block_style = "expression"'
|
||||
assert_correct_indenting <<~EOF
|
||||
x = *
|
||||
array.map do
|
||||
|
@ -1,6 +1,16 @@
|
||||
require 'vimrunner'
|
||||
require 'vimrunner/rspec'
|
||||
|
||||
RSpec.configure do |config|
|
||||
# reset globals to default values before each test
|
||||
config.before(:each) do
|
||||
vim.command 'let g:ruby_indent_access_modifier_style = "normal"'
|
||||
vim.command 'let g:ruby_indent_block_style = "do"'
|
||||
vim.command 'let g:ruby_indent_assignment_style = "hanging"'
|
||||
vim.command 'let g:ruby_indent_hanging_elements = 1'
|
||||
end
|
||||
end
|
||||
|
||||
Vimrunner::RSpec.configure do |config|
|
||||
config.reuse_server = true
|
||||
|
||||
|
Reference in New Issue
Block a user