diff options
author | George Roman <george.roman.99@gmail.com> | 2018-04-19 18:42:01 +0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-04-24 17:15:35 -0300 |
commit | bcb010c10a795f565271cedb46af6aadba429205 (patch) | |
tree | df5704dbd995aee6242b9a43602523480f4d869a /spec/fs_spec.lua | |
parent | 315773caf4ee32c440df27d2339ad0f00460e8c5 (diff) | |
download | luarocks-bcb010c10a795f565271cedb46af6aadba429205.tar.gz luarocks-bcb010c10a795f565271cedb46af6aadba429205.tar.bz2 luarocks-bcb010c10a795f565271cedb46af6aadba429205.zip |
Make copy_contents have the same behaviour on Windows and on Unix
Diffstat (limited to 'spec/fs_spec.lua')
-rw-r--r-- | spec/fs_spec.lua | 17 |
1 files changed, 3 insertions, 14 deletions
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() | |||
564 | fd:close() | 564 | fd:close() |
565 | dstdir = os.tmpname() | 565 | dstdir = os.tmpname() |
566 | os.remove(dstdir) | 566 | os.remove(dstdir) |
567 | if is_win then | ||
568 | lfs.mkdir(dstdir) | ||
569 | end | ||
570 | end | 567 | end |
571 | 568 | ||
572 | it("returns true and copies the contents (with their permissions) of the source dir to the destination dir", function() | 569 | 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() | |||
604 | os.remove(srcdir) | 601 | os.remove(srcdir) |
605 | dstdir = os.tmpname() | 602 | dstdir = os.tmpname() |
606 | os.remove(dstdir) | 603 | os.remove(dstdir) |
607 | if is_win then | 604 | assert.falsy(fs.copy_contents(srcdir, dstdir, nil)) |
608 | fs.copy_contents(srcdir, dstdir, nil) | ||
609 | else | ||
610 | assert.falsy(pcall(fs.copy_contents, srcdir, dstdir, nil)) | ||
611 | end | ||
612 | assert.falsy(exists_file(dstdir)) | 605 | assert.falsy(exists_file(dstdir)) |
613 | end) | 606 | end) |
614 | 607 | ||
@@ -619,18 +612,14 @@ describe("Luarocks fs test #whitebox #w_fs", function() | |||
619 | fd:close() | 612 | fd:close() |
620 | dstdir = os.tmpname() | 613 | dstdir = os.tmpname() |
621 | os.remove(dstdir) | 614 | os.remove(dstdir) |
622 | if is_win then | 615 | assert.falsy(fs.copy_contents(srcdir, dstdir, nil)) |
623 | fs.copy_contents(srcdir, dstdir, nil) | ||
624 | else | ||
625 | assert.falsy(pcall(fs.copy_contents, srcdir, dstdir, nil)) | ||
626 | end | ||
627 | assert.falsy(exists_file(dstdir)) | 616 | assert.falsy(exists_file(dstdir)) |
628 | end) | 617 | end) |
629 | 618 | ||
630 | it("returns false and does nothing if the source dir doesn't have the proper permissions #unix", function() | 619 | it("returns false and does nothing if the source dir doesn't have the proper permissions #unix", function() |
631 | create_dir_tree() | 620 | create_dir_tree() |
632 | assert(fs.chmod(srcdir, "333")) | 621 | assert(fs.chmod(srcdir, "333")) |
633 | assert.falsy(pcall(fs.copy_contents, srcdir, dstdir, nil)) | 622 | assert.falsy(fs.copy_contents(srcdir, dstdir, nil)) |
634 | assert.falsy(exists_file(dstdir)) | 623 | assert.falsy(exists_file(dstdir)) |
635 | end) | 624 | end) |
636 | end) | 625 | end) |