From c296a0b91d3a8b4eac2d3324a9b3c8e0a618817a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Gamb=C3=B6ck?= Date: Sun, 2 Jul 2017 16:04:54 +0200 Subject: [PATCH] Remove obsolete redefinition of popen With the directory being changed via luafilesystem, there is no need to redefine internal functions. --- spec/awful/completion_spec.lua | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/spec/awful/completion_spec.lua b/spec/awful/completion_spec.lua index 05deab19e..798162239 100644 --- a/spec/awful/completion_spec.lua +++ b/spec/awful/completion_spec.lua @@ -60,21 +60,16 @@ local function get_test_dir() end describe("awful.completion.shell in empty directory", function() - local orig_popen = io.popen local orig_dir = lfs.currentdir() setup(function() test_dir = get_test_dir() - io.popen = function(...) --luacheck: ignore - return orig_popen(string.format('cd %s && ', test_dir) .. ...) - end lfs.chdir(test_dir) test_path = get_test_path_dir() end) teardown(function() assert.True(os.remove(test_dir)) - io.popen = orig_popen --luacheck: ignore remove_test_path_dir(test_path) lfs.chdir(orig_dir) end) @@ -95,7 +90,6 @@ describe("awful.completion.shell in empty directory", function() end) describe("awful.completion.shell", function() - local orig_popen = io.popen local orig_dir = lfs.currentdir() setup(function() @@ -104,9 +98,6 @@ describe("awful.completion.shell", function() gfs.make_directories(test_dir .. '/just_a_directory') os.execute(string.format( '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) test_path = get_test_path_dir() end) @@ -116,7 +107,6 @@ describe("awful.completion.shell", function() assert.True(os.remove(test_dir .. '/localcommand')) assert.True(os.remove(test_dir .. '/true')) assert.True(os.remove(test_dir)) - io.popen = orig_popen --luacheck: ignore remove_test_path_dir(test_path) lfs.chdir(orig_dir) end)