diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 21:28:36 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 22:54:08 -0300 |
| commit | 121ba1ace77b0dbe4b35d25fcb88ece8606ec685 (patch) | |
| tree | 38d22460f8b4335aab2d433c656b527ef8d749f9 | |
| parent | d5eae550c9368bd07008104bdecbcc5eb28814e2 (diff) | |
| download | luarocks-121ba1ace77b0dbe4b35d25fcb88ece8606ec685.tar.gz luarocks-121ba1ace77b0dbe4b35d25fcb88ece8606ec685.tar.bz2 luarocks-121ba1ace77b0dbe4b35d25fcb88ece8606ec685.zip | |
Tests: improve isolation of tests
| -rw-r--r-- | spec/util/test_env.lua | 1 | ||||
| -rw-r--r-- | spec/write_rockspec_spec.lua | 23 |
2 files changed, 14 insertions, 10 deletions
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 60162ee3..51893e83 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
| @@ -120,6 +120,7 @@ function test_env.execute_helper(command, print_command, env_variables) | |||
| 120 | "LUA_CPATH_5_2", | 120 | "LUA_CPATH_5_2", |
| 121 | "LUA_PATH_5_3", | 121 | "LUA_PATH_5_3", |
| 122 | "LUA_CPATH_5_3", | 122 | "LUA_CPATH_5_3", |
| 123 | "LUAROCKS_SYSCONFDIR", | ||
| 123 | } | 124 | } |
| 124 | 125 | ||
| 125 | if env_variables then | 126 | if env_variables then |
diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua index 295eaa6b..1fb53547 100644 --- a/spec/write_rockspec_spec.lua +++ b/spec/write_rockspec_spec.lua | |||
| @@ -9,16 +9,6 @@ describe("LuaRocks write_rockspec tests #integration", function() | |||
| 9 | test_env.setup_specs() | 9 | test_env.setup_specs() |
| 10 | end) | 10 | end) |
| 11 | 11 | ||
| 12 | it("runs with no flags/arguments", function() | ||
| 13 | local d = lfs.currentdir() | ||
| 14 | finally(function() | ||
| 15 | os.remove("testrock-dev-1.rockspec") | ||
| 16 | lfs.chdir(d) | ||
| 17 | end) | ||
| 18 | lfs.chdir("..") | ||
| 19 | assert.is_true(run.luarocks_bool("write_rockspec")) | ||
| 20 | end) | ||
| 21 | |||
| 22 | it("fails with invalid argument", function() | 12 | it("fails with invalid argument", function() |
| 23 | assert.is_false(run.luarocks_bool("write_rockspec invalid")) | 13 | assert.is_false(run.luarocks_bool("write_rockspec invalid")) |
| 24 | end) | 14 | end) |
| @@ -38,6 +28,19 @@ describe("LuaRocks write_rockspec tests #integration", function() | |||
| 38 | git:stop() | 28 | git:stop() |
| 39 | end) | 29 | end) |
| 40 | 30 | ||
| 31 | it("runs with no flags/arguments", function() | ||
| 32 | local d = lfs.currentdir() | ||
| 33 | finally(function() | ||
| 34 | os.remove("testrock-dev-1.rockspec") | ||
| 35 | lfs.chdir(d) | ||
| 36 | test_env.remove_dir("testrock") | ||
| 37 | end) | ||
| 38 | os.execute("git clone git://localhost/testrock") | ||
| 39 | lfs.chdir("testrock") | ||
| 40 | assert.is_true(run.luarocks_bool("write_rockspec")) | ||
| 41 | assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec")) | ||
| 42 | end) | ||
| 43 | |||
| 41 | it("runs", function() | 44 | it("runs", function() |
| 42 | finally(function() os.remove("testrock-dev-1.rockspec") end) | 45 | finally(function() os.remove("testrock-dev-1.rockspec") end) |
| 43 | assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock")) | 46 | assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock")) |
