From bcb010c10a795f565271cedb46af6aadba429205 Mon Sep 17 00:00:00 2001 From: George Roman Date: Thu, 19 Apr 2018 18:42:01 +0300 Subject: Make copy_contents have the same behaviour on Windows and on Unix --- spec/fs_spec.lua | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'spec/fs_spec.lua') diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index b36fded3..a74980f3 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua @@ -564,9 +564,6 @@ describe("Luarocks fs test #whitebox #w_fs", function() fd:close() dstdir = os.tmpname() os.remove(dstdir) - if is_win then - lfs.mkdir(dstdir) - end end it("returns true and copies the contents (with their permissions) of the source dir to the destination dir", function() @@ -604,11 +601,7 @@ describe("Luarocks fs test #whitebox #w_fs", function() os.remove(srcdir) dstdir = os.tmpname() os.remove(dstdir) - if is_win then - fs.copy_contents(srcdir, dstdir, nil) - else - assert.falsy(pcall(fs.copy_contents, srcdir, dstdir, nil)) - end + assert.falsy(fs.copy_contents(srcdir, dstdir, nil)) assert.falsy(exists_file(dstdir)) end) @@ -619,18 +612,14 @@ describe("Luarocks fs test #whitebox #w_fs", function() fd:close() dstdir = os.tmpname() os.remove(dstdir) - if is_win then - fs.copy_contents(srcdir, dstdir, nil) - else - assert.falsy(pcall(fs.copy_contents, srcdir, dstdir, nil)) - end + assert.falsy(fs.copy_contents(srcdir, dstdir, nil)) assert.falsy(exists_file(dstdir)) end) it("returns false and does nothing if the source dir doesn't have the proper permissions #unix", function() create_dir_tree() assert(fs.chmod(srcdir, "333")) - assert.falsy(pcall(fs.copy_contents, srcdir, dstdir, nil)) + assert.falsy(fs.copy_contents(srcdir, dstdir, nil)) assert.falsy(exists_file(dstdir)) end) end) -- cgit v1.2.3-55-g6feb