refactor(config): remove legacy gcal top-level config key (#51)
* refactor(config): remove legacy gcal top-level config key
Problem: the gcal migration shim silently accepted vim.g.pending = { gcal
= {...} } and copied it to sync.gcal, adding complexity and a deprecated
API surface.
Solution: remove the migration block in config.get(), drop the cfg.gcal
fallback in gcal_config(), delete the two migration tests, and clean up
the vimdoc references. Callers must now use sync.gcal directly.
* ci: fix
* fix(spec): remove duplicate buffer require in complete_spec
This commit is contained in:
parent
ef58f69f74
commit
0cdb4e6dd6
5 changed files with 9 additions and 49 deletions
|
|
@ -112,39 +112,14 @@ describe('sync', function()
|
|||
end)
|
||||
end)
|
||||
|
||||
describe('config migration', function()
|
||||
it('migrates legacy gcal to sync.gcal', function()
|
||||
config.reset()
|
||||
vim.g.pending = {
|
||||
data_path = tmpdir .. '/tasks.json',
|
||||
gcal = { calendar = 'MyCalendar' },
|
||||
}
|
||||
local cfg = config.get()
|
||||
assert.is_not_nil(cfg.sync)
|
||||
assert.is_not_nil(cfg.sync.gcal)
|
||||
assert.are.equal('MyCalendar', cfg.sync.gcal.calendar)
|
||||
end)
|
||||
|
||||
it('does not overwrite explicit sync.gcal with legacy gcal', function()
|
||||
config.reset()
|
||||
vim.g.pending = {
|
||||
data_path = tmpdir .. '/tasks.json',
|
||||
gcal = { calendar = 'Legacy' },
|
||||
sync = { gcal = { calendar = 'Explicit' } },
|
||||
}
|
||||
local cfg = config.get()
|
||||
assert.are.equal('Explicit', cfg.sync.gcal.calendar)
|
||||
end)
|
||||
|
||||
it('works with sync.gcal and no legacy gcal', function()
|
||||
config.reset()
|
||||
vim.g.pending = {
|
||||
data_path = tmpdir .. '/tasks.json',
|
||||
sync = { gcal = { calendar = 'NewStyle' } },
|
||||
}
|
||||
local cfg = config.get()
|
||||
assert.are.equal('NewStyle', cfg.sync.gcal.calendar)
|
||||
end)
|
||||
it('works with sync.gcal config', function()
|
||||
config.reset()
|
||||
vim.g.pending = {
|
||||
data_path = tmpdir .. '/tasks.json',
|
||||
sync = { gcal = { calendar = 'NewStyle' } },
|
||||
}
|
||||
local cfg = config.get()
|
||||
assert.are.equal('NewStyle', cfg.sync.gcal.calendar)
|
||||
end)
|
||||
|
||||
describe('gcal module', function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue