Remove obsolete redefinition of popen
With the directory being changed via luafilesystem, there is no need to redefine internal functions.
This commit is contained in:
parent
8e2d844f60
commit
c296a0b91d
|
@ -60,21 +60,16 @@ local function get_test_dir()
|
||||||
end
|
end
|
||||||
|
|
||||||
describe("awful.completion.shell in empty directory", function()
|
describe("awful.completion.shell in empty directory", function()
|
||||||
local orig_popen = io.popen
|
|
||||||
local orig_dir = lfs.currentdir()
|
local orig_dir = lfs.currentdir()
|
||||||
|
|
||||||
setup(function()
|
setup(function()
|
||||||
test_dir = get_test_dir()
|
test_dir = get_test_dir()
|
||||||
io.popen = function(...) --luacheck: ignore
|
|
||||||
return orig_popen(string.format('cd %s && ', test_dir) .. ...)
|
|
||||||
end
|
|
||||||
lfs.chdir(test_dir)
|
lfs.chdir(test_dir)
|
||||||
test_path = get_test_path_dir()
|
test_path = get_test_path_dir()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
teardown(function()
|
teardown(function()
|
||||||
assert.True(os.remove(test_dir))
|
assert.True(os.remove(test_dir))
|
||||||
io.popen = orig_popen --luacheck: ignore
|
|
||||||
remove_test_path_dir(test_path)
|
remove_test_path_dir(test_path)
|
||||||
lfs.chdir(orig_dir)
|
lfs.chdir(orig_dir)
|
||||||
end)
|
end)
|
||||||
|
@ -95,7 +90,6 @@ describe("awful.completion.shell in empty directory", function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe("awful.completion.shell", function()
|
describe("awful.completion.shell", function()
|
||||||
local orig_popen = io.popen
|
|
||||||
local orig_dir = lfs.currentdir()
|
local orig_dir = lfs.currentdir()
|
||||||
|
|
||||||
setup(function()
|
setup(function()
|
||||||
|
@ -104,9 +98,6 @@ describe("awful.completion.shell", function()
|
||||||
gfs.make_directories(test_dir .. '/just_a_directory')
|
gfs.make_directories(test_dir .. '/just_a_directory')
|
||||||
os.execute(string.format(
|
os.execute(string.format(
|
||||||
'cd %s && touch localcommand && chmod +x localcommand', test_dir))
|
'cd %s && touch localcommand && chmod +x localcommand', test_dir))
|
||||||
io.popen = function(...) --luacheck: ignore
|
|
||||||
return orig_popen(string.format('cd %s && ', test_dir) .. ...)
|
|
||||||
end
|
|
||||||
lfs.chdir(test_dir)
|
lfs.chdir(test_dir)
|
||||||
test_path = get_test_path_dir()
|
test_path = get_test_path_dir()
|
||||||
end)
|
end)
|
||||||
|
@ -116,7 +107,6 @@ describe("awful.completion.shell", function()
|
||||||
assert.True(os.remove(test_dir .. '/localcommand'))
|
assert.True(os.remove(test_dir .. '/localcommand'))
|
||||||
assert.True(os.remove(test_dir .. '/true'))
|
assert.True(os.remove(test_dir .. '/true'))
|
||||||
assert.True(os.remove(test_dir))
|
assert.True(os.remove(test_dir))
|
||||||
io.popen = orig_popen --luacheck: ignore
|
|
||||||
remove_test_path_dir(test_path)
|
remove_test_path_dir(test_path)
|
||||||
lfs.chdir(orig_dir)
|
lfs.chdir(orig_dir)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue