From 973d03baa451d7232bf7bf463015e7e1de6f5336 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 19 Sep 2025 00:29:36 -0400 Subject: [PATCH] fix --- spec/integration_spec.lua | 43 +++++++++++++++++++++++++-------------- spec/test_panel_spec.lua | 4 ++++ 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/spec/integration_spec.lua b/spec/integration_spec.lua index d0fb17f..35f2774 100644 --- a/spec/integration_spec.lua +++ b/spec/integration_spec.lua @@ -29,7 +29,7 @@ describe('cp integration', function() if cmd[1] == 'ping' then result = { code = 0, stdout = '', stderr = '' } elseif cmd[1] == 'uv' and cmd[2] == 'sync' then - result = { code = 0, stdout = '', stderr = '' } + result = { code = 0, stdout = 'Dependencies synced', stderr = '' } elseif cmd[1] == 'uv' and cmd[2] == 'run' then if vim.tbl_contains(cmd, 'metadata') then result.stdout = @@ -88,20 +88,33 @@ describe('cp integration', function() nvim_input = function() end, }) - vim.cmd = function(cmd_str) - if cmd_str == 'silent only' then - return - end - if cmd_str:match('^e ') then - return - end - if cmd_str == 'startinsert' then - return - end - if cmd_str == 'stopinsert' then - return - end - end + local cmd_table = { + split = function() end, + vsplit = function() end, + diffthis = function() end, + e = function() end, + startinsert = function() end, + stopinsert = function() end, + } + + vim.cmd = setmetatable(cmd_table, { + __call = function(_, cmd_str) + if cmd_str == 'silent only' then + return + end + if cmd_str:match('^e ') then + return + end + if cmd_str == 'startinsert' then + return + end + if cmd_str == 'stopinsert' then + return + end + end, + __index = cmd_table, + __newindex = cmd_table, + }) vim.schedule = function(fn) fn() diff --git a/spec/test_panel_spec.lua b/spec/test_panel_spec.lua index c7c77fc..351be9c 100644 --- a/spec/test_panel_spec.lua +++ b/spec/test_panel_spec.lua @@ -29,6 +29,10 @@ describe('cp test panel', function() return nil end, set_test_cases = function() end, + get_contest_data = function() + return nil + end, + set_contest_data = function() end, } package.loaded['cp.cache'] = mock_cache