test: refactor tests to use new helper methods
This commit is contained in:
parent
57528bf9c5
commit
2f6ed70161
5 changed files with 22 additions and 33 deletions
|
|
@ -9,32 +9,28 @@ a.describe("window options", function()
|
|||
|
||||
a.it("Restores window options on close", function()
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
test_util.oil_open()
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
oil.close()
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
end)
|
||||
|
||||
a.it("Restores window options on edit", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
test_util.oil_open()
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
end)
|
||||
|
||||
a.it("Restores window options on split <filename>", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
test_util.oil_open()
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.split({ args = { "README.md" } })
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
end)
|
||||
|
||||
a.it("Restores window options on split", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
test_util.oil_open()
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.split()
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
|
|
@ -42,16 +38,14 @@ a.describe("window options", function()
|
|||
end)
|
||||
|
||||
a.it("Restores window options on tabnew <filename>", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
test_util.oil_open()
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.tabnew({ args = { "README.md" } })
|
||||
assert.equals("auto", vim.o.signcolumn)
|
||||
end)
|
||||
|
||||
a.it("Restores window options on tabnew", function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
|
||||
test_util.oil_open()
|
||||
assert.equals("no", vim.o.signcolumn)
|
||||
vim.cmd.tabnew()
|
||||
vim.cmd.edit({ args = { "README.md" } })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue