diff options
| author | George Roman <george.roman.99@gmail.com> | 2018-07-24 11:09:42 +0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-24 15:41:22 -0300 |
| commit | 8e6a83911027de167d689d060ce581f653d73213 (patch) | |
| tree | 622218f964f10a27b7922bcfcd3bf14fd6c1735b /spec/install_spec.lua | |
| parent | 961670659be3e986bc74b9b8c2a296f4640302e5 (diff) | |
| download | luarocks-8e6a83911027de167d689d060ce581f653d73213.tar.gz luarocks-8e6a83911027de167d689d060ce581f653d73213.tar.bz2 luarocks-8e6a83911027de167d689d060ce581f653d73213.zip | |
Tests: add test_env.run_in_tmp utility function
Diffstat (limited to 'spec/install_spec.lua')
| -rw-r--r-- | spec/install_spec.lua | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 8a5d8f09..0555155b 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
| @@ -57,18 +57,12 @@ describe("luarocks install #integration", function() | |||
| 57 | end) | 57 | end) |
| 58 | 58 | ||
| 59 | it("fails not a zip file", function() | 59 | it("fails not a zip file", function() |
| 60 | local olddir = lfs.currentdir() | 60 | test_env.run_in_tmp(function(tmpdir) |
| 61 | local tmpdir = get_tmp_path() | 61 | write_file("not_a_zipfile-1.0-1.src.rock", [[ |
| 62 | lfs.mkdir(tmpdir) | 62 | I am not a .zip file! |
| 63 | lfs.chdir(tmpdir) | 63 | ]], finally) |
| 64 | 64 | assert.is_false(run.luarocks_bool("install not_a_zipfile-1.0-1.src.rock")) | |
| 65 | write_file("not_a_zipfile-1.0-1.src.rock", [[ | 65 | end, finally) |
| 66 | I am not a .zip file! | ||
| 67 | ]], finally) | ||
| 68 | assert.is_false(run.luarocks_bool("install not_a_zipfile-1.0-1.src.rock")) | ||
| 69 | |||
| 70 | lfs.chdir(olddir) | ||
| 71 | lfs.rmdir(tmpdir) | ||
| 72 | end) | 66 | end) |
| 73 | 67 | ||
| 74 | it("only-deps of lxsh show there is no lxsh", function() | 68 | it("only-deps of lxsh show there is no lxsh", function() |
