From 04f2f864e270e772c6326cefdf24947f0130e492 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 3 Jan 2024 02:09:18 +0100 Subject: refactor: format test/* --- test/functional/provider/ruby_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/provider/ruby_spec.lua') diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua index d3b967dfbe..56919d401c 100644 --- a/test/functional/provider/ruby_spec.lua +++ b/test/functional/provider/ruby_spec.lua @@ -43,7 +43,7 @@ end) describe(':ruby command', function() it('evaluates ruby', function() command('ruby VIM.command("let g:set_by_ruby = [100, 0]")') - eq({100, 0}, meths.get_var('set_by_ruby')) + eq({ 100, 0 }, meths.get_var('set_by_ruby')) end) it('supports nesting', function() @@ -112,7 +112,7 @@ 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' } }, funcs.rubyeval('[1, 2, {key: "val"}]')) end) it('returns nil for empty strings', function() -- cgit From d33e1da9b7f7e886219cfdd20b9bbfaccdc43be9 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 11:28:20 +0000 Subject: test: do not inject vim module into global helpers --- test/functional/provider/ruby_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/provider/ruby_spec.lua') diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua index 56919d401c..438f41450a 100644 --- a/test/functional/provider/ruby_spec.lua +++ b/test/functional/provider/ruby_spec.lua @@ -116,7 +116,7 @@ describe('rubyeval()', function() end) it('returns nil for empty strings', function() - eq(helpers.NIL, funcs.rubyeval('')) + eq(vim.NIL, funcs.rubyeval('')) end) it('errors out when given non-string', function() -- cgit From c30f2e3182e3b50e7c03932027ac55edfc8ada4a Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 12:44:54 +0000 Subject: test: typing for helpers.meths --- test/functional/provider/ruby_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/functional/provider/ruby_spec.lua') diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua index 438f41450a..2a64830bca 100644 --- a/test/functional/provider/ruby_spec.lua +++ b/test/functional/provider/ruby_spec.lua @@ -43,12 +43,12 @@ end) describe(':ruby command', function() it('evaluates ruby', function() command('ruby VIM.command("let g:set_by_ruby = [100, 0]")') - eq({ 100, 0 }, meths.get_var('set_by_ruby')) + eq({ 100, 0 }, meths.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.get_var('set_by_nested_ruby')) + eq(555, meths.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.get_var('set_by_rubyfile')) + eq(123, meths.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.get_option_value('modified', {})) + eq(false, meths.nvim_get_option_value('modified', {})) end) end) -- cgit From 795f896a5772d5e0795f86642bdf90c82efac45c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 17:59:57 +0000 Subject: test: rename (meths, funcs) -> (api, fn) --- test/functional/provider/ruby_spec.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/functional/provider/ruby_spec.lua') diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua index 2a64830bca..9b2531a23c 100644 --- a/test/functional/provider/ruby_spec.lua +++ b/test/functional/provider/ruby_spec.lua @@ -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() -- cgit