aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/fetch_spec.lua11
-rw-r--r--spec/fs_spec.lua11
-rw-r--r--spec/fun_spec.lua14
-rw-r--r--spec/persist_spec.lua12
-rw-r--r--spec/util_spec.lua11
5 files changed, 58 insertions, 1 deletions
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua
index be138b8c..30709fcb 100644
--- a/spec/fetch_spec.lua
+++ b/spec/fetch_spec.lua
@@ -14,6 +14,17 @@ describe("Luarocks fetch test #unit", function()
14 return file1 == file2 or lfs.attributes(file1).ino == lfs.attributes(file2).ino 14 return file1 == file2 or lfs.attributes(file1).ino == lfs.attributes(file2).ino
15 end 15 end
16 16
17 local runner
18
19 setup(function()
20 runner = require("luacov.runner")
21 runner.init(testing_paths.testrun_dir .. "/luacov.config")
22 end)
23
24 teardown(function()
25 runner.shutdown()
26 end)
27
17 describe("fetch.is_basic_protocol", function() 28 describe("fetch.is_basic_protocol", function()
18 it("checks whether the arguments represent a valid protocol and returns the result of the check", function() 29 it("checks whether the arguments represent a valid protocol and returns the result of the check", function()
19 assert.truthy(fetch.is_basic_protocol("http")) 30 assert.truthy(fetch.is_basic_protocol("http"))
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua
index 2d0059b6..e09ac6df 100644
--- a/spec/fs_spec.lua
+++ b/spec/fs_spec.lua
@@ -50,6 +50,17 @@ describe("Luarocks fs test #unit", function()
50 fs.execute("chmod -x " .. fs.Q(path)) 50 fs.execute("chmod -x " .. fs.Q(path))
51 end 51 end
52 end 52 end
53
54 local runner
55
56 setup(function()
57 runner = require("luacov.runner")
58 runner.init(testing_paths.testrun_dir .. "/luacov.config")
59 end)
60
61 teardown(function()
62 runner.shutdown()
63 end)
53 64
54 describe("fs.Q", function() 65 describe("fs.Q", function()
55 it("simple argument", function() 66 it("simple argument", function()
diff --git a/spec/fun_spec.lua b/spec/fun_spec.lua
index 259a3148..b0a082ac 100644
--- a/spec/fun_spec.lua
+++ b/spec/fun_spec.lua
@@ -1,9 +1,21 @@
1local test_env = require("spec.util.test_env") 1local test_env = require("spec.util.test_env")
2local fun = require("luarocks.fun") 2local testing_paths = test_env.testing_paths
3 3
4test_env.unload_luarocks() 4test_env.unload_luarocks()
5local fun = require("luarocks.fun")
5 6
6describe("LuaRocks fun tests #unit", function() 7describe("LuaRocks fun tests #unit", function()
8 local runner
9
10 setup(function()
11 runner = require("luacov.runner")
12 runner.init(testing_paths.testrun_dir .. "/luacov.config")
13 end)
14
15 teardown(function()
16 runner.shutdown()
17 end)
18
7 describe("fun.concat", function() 19 describe("fun.concat", function()
8 it("returns the concatenation of the two tables given as arguments", function() 20 it("returns the concatenation of the two tables given as arguments", function()
9 local t1, t2 21 local t1, t2
diff --git a/spec/persist_spec.lua b/spec/persist_spec.lua
index f61c7176..339147b1 100644
--- a/spec/persist_spec.lua
+++ b/spec/persist_spec.lua
@@ -1,9 +1,21 @@
1local test_env = require("spec.util.test_env") 1local test_env = require("spec.util.test_env")
2local testing_paths = test_env.testing_paths
2 3
3test_env.unload_luarocks() 4test_env.unload_luarocks()
4local persist = require("luarocks.persist") 5local persist = require("luarocks.persist")
5 6
6describe("Luarocks persist test #unit", function() 7describe("Luarocks persist test #unit", function()
8 local runner
9
10 setup(function()
11 runner = require("luacov.runner")
12 runner.init(testing_paths.testrun_dir .. "/luacov.config")
13 end)
14
15 teardown(function()
16 runner.shutdown()
17 end)
18
7 describe("persist.save_from_table_to_string", function() 19 describe("persist.save_from_table_to_string", function()
8 it("simple table", function() 20 it("simple table", function()
9 assert.are.same([[ 21 assert.are.same([[
diff --git a/spec/util_spec.lua b/spec/util_spec.lua
index ce309138..075a2122 100644
--- a/spec/util_spec.lua
+++ b/spec/util_spec.lua
@@ -74,6 +74,17 @@ test_env.unload_luarocks()
74local util = require("luarocks.util") 74local util = require("luarocks.util")
75 75
76describe("Luarocks util test #unit", function() 76describe("Luarocks util test #unit", function()
77 local runner
78
79 setup(function()
80 runner = require("luacov.runner")
81 runner.init(testing_paths.testrun_dir .. "/luacov.config")
82 end)
83
84 teardown(function()
85 runner.shutdown()
86 end)
87
77 describe("util.sortedpairs", function() 88 describe("util.sortedpairs", function()
78 local function collect(iter, state, var) 89 local function collect(iter, state, var)
79 local collected = {} 90 local collected = {}