mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
test: rename (meths, funcs) -> (api, fn)
This commit is contained in:
@@ -8,9 +8,9 @@ local exc_exec = helpers.exc_exec
|
||||
local expect = helpers.expect
|
||||
local feed = helpers.feed
|
||||
local feed_command = helpers.feed_command
|
||||
local funcs = helpers.funcs
|
||||
local fn = helpers.fn
|
||||
local insert = helpers.insert
|
||||
local meths = helpers.meths
|
||||
local api = helpers.api
|
||||
local missing_provider = helpers.missing_provider
|
||||
local matches = helpers.matches
|
||||
local write_file = helpers.write_file
|
||||
@@ -36,19 +36,19 @@ end)
|
||||
|
||||
describe('ruby feature test', function()
|
||||
it('works', function()
|
||||
eq(1, funcs.has('ruby'))
|
||||
eq(1, fn.has('ruby'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe(':ruby command', function()
|
||||
it('evaluates ruby', function()
|
||||
command('ruby VIM.command("let g:set_by_ruby = [100, 0]")')
|
||||
eq({ 100, 0 }, meths.nvim_get_var('set_by_ruby'))
|
||||
eq({ 100, 0 }, api.nvim_get_var('set_by_ruby'))
|
||||
end)
|
||||
|
||||
it('supports nesting', function()
|
||||
command([[ruby VIM.command('ruby VIM.command("let set_by_nested_ruby = 555")')]])
|
||||
eq(555, meths.nvim_get_var('set_by_nested_ruby'))
|
||||
eq(555, api.nvim_get_var('set_by_nested_ruby'))
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -57,7 +57,7 @@ describe(':rubyfile command', function()
|
||||
local fname = 'rubyfile.rb'
|
||||
write_file(fname, 'VIM.command("let set_by_rubyfile = 123")')
|
||||
command('rubyfile rubyfile.rb')
|
||||
eq(123, meths.nvim_get_var('set_by_rubyfile'))
|
||||
eq(123, api.nvim_get_var('set_by_rubyfile'))
|
||||
os.remove(fname)
|
||||
end)
|
||||
end)
|
||||
@@ -97,7 +97,7 @@ describe(':rubydo command', function()
|
||||
|
||||
it('does not modify the buffer if no changes are made', function()
|
||||
command('normal :rubydo 42')
|
||||
eq(false, meths.nvim_get_option_value('modified', {}))
|
||||
eq(false, api.nvim_get_option_value('modified', {}))
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -112,11 +112,11 @@ end)
|
||||
|
||||
describe('rubyeval()', function()
|
||||
it('evaluates ruby objects', function()
|
||||
eq({ 1, 2, { ['key'] = 'val' } }, funcs.rubyeval('[1, 2, {key: "val"}]'))
|
||||
eq({ 1, 2, { ['key'] = 'val' } }, fn.rubyeval('[1, 2, {key: "val"}]'))
|
||||
end)
|
||||
|
||||
it('returns nil for empty strings', function()
|
||||
eq(vim.NIL, funcs.rubyeval(''))
|
||||
eq(vim.NIL, fn.rubyeval(''))
|
||||
end)
|
||||
|
||||
it('errors out when given non-string', function()
|
||||
|
Reference in New Issue
Block a user