aboutsummaryrefslogtreecommitdiff
path: root/spec/purge_spec.lua
blob: 09a9d43328cb3131d421aff778465e6d422451d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local test_env = require("test/test_environment")
local run = test_env.run
local testing_paths = test_env.testing_paths

test_env.unload_luarocks()

describe("LuaRocks purge tests #blackbox #b_purge", function()
   before_each(function()
      test_env.setup_specs()
   end)

   describe("LuaRocks purge basic tests", function()
      it("LuaRocks purge missing tree", function()
         assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree))
      end)
      it("LuaRocks purge tree with no string", function()
         assert.is_false(run.luarocks_bool("purge --tree=1"))
      end)
      it("LuaRocks purge tree with no string", function()
         assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree))
      end)
      it("LuaRocks purge old versions tree", function()
         assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree))
      end)
   end)
end)