aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorroboo <robo.karasek@gmail.com>2016-07-14 00:29:01 +0200
committerroboo <robo.karasek@gmail.com>2016-07-14 00:29:01 +0200
commit1656a4c7a2dac25d2dd2e5d2211ce0e7eb000b19 (patch)
tree6aa4d66409112e10ac40968ec439d3ceddc6e5a6 /spec
parentfe79525c26449576322ca5aa736d72d100313be4 (diff)
downloadluarocks-1656a4c7a2dac25d2dd2e5d2211ce0e7eb000b19.tar.gz
luarocks-1656a4c7a2dac25d2dd2e5d2211ce0e7eb000b19.tar.bz2
luarocks-1656a4c7a2dac25d2dd2e5d2211ce0e7eb000b19.zip
need_rock() added, new flag noreset environment
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua2
-rw-r--r--spec/install_spec.lua3
-rw-r--r--spec/remove_spec.lua7
3 files changed, 4 insertions, 8 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 1ce99089..682c6dcf 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -169,12 +169,10 @@ describe("LuaRocks build tests #blackbox #b_build", function()
169 end) 169 end)
170 170
171 it("LuaRocks build missing external", function() 171 it("LuaRocks build missing external", function()
172 assert.is_true(test_env.need_luasocket())
173 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/missing_external-0.1-1.rockspec INEXISTENT_INCDIR=\"/invalid/dir\"")) 172 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/missing_external-0.1-1.rockspec INEXISTENT_INCDIR=\"/invalid/dir\""))
174 end) 173 end)
175 174
176 it("LuaRocks build invalid patch", function() 175 it("LuaRocks build invalid patch", function()
177 assert.is_true(test_env.need_luasocket())
178 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec")) 176 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec"))
179 end) 177 end)
180 end) 178 end)
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index 0e406e22..9bc11e87 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -83,20 +83,17 @@ describe("LuaRocks install tests #blackbox #b_install", function()
83 end) 83 end)
84 84
85 it("LuaRocks install only-deps of luasocket packed rock", function() 85 it("LuaRocks install only-deps of luasocket packed rock", function()
86 assert.is_true(test_env.need_luasocket())
87 local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock") 86 local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")
88 assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1") 87 assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1")
89 end) 88 end)
90 89
91 it("LuaRocks install binary rock of cprint", function() 90 it("LuaRocks install binary rock of cprint", function()
92 assert.is_true(test_env.need_luasocket())
93 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) 91 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint"))
94 assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock")) 92 assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock"))
95 assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")) 93 assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock"))
96 end) 94 end)
97 95
98 it("LuaRocks install reinstall", function() 96 it("LuaRocks install reinstall", function()
99 assert.is_true(test_env.need_luasocket())
100 assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) 97 assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock"))
101 assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) 98 assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock"))
102 end) 99 end)
diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua
index 41c6348a..c7f83b95 100644
--- a/spec/remove_spec.lua
+++ b/spec/remove_spec.lua
@@ -44,8 +44,11 @@ describe("LuaRocks remove tests #blackbox #b_remove", function()
44 end) 44 end)
45 45
46 describe("LuaRocks remove more complex tests", function() 46 describe("LuaRocks remove more complex tests", function()
47 before_each(function()
48 assert.is_true(test_env.need_rock("luasocket"))
49 end)
50
47 it("LuaRocks remove fail, break dependencies", function() 51 it("LuaRocks remove fail, break dependencies", function()
48 assert.is_true(test_env.need_luasocket())
49 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) 52 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket"))
50 assert.is_true(run.luarocks_bool("build lualogging")) 53 assert.is_true(run.luarocks_bool("build lualogging"))
51 54
@@ -54,7 +57,6 @@ describe("LuaRocks remove tests #blackbox #b_remove", function()
54 end) 57 end)
55 58
56 it("LuaRocks remove force", function() 59 it("LuaRocks remove force", function()
57 assert.is_true(test_env.need_luasocket())
58 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) 60 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket"))
59 assert.is_true(run.luarocks_bool("build lualogging")) 61 assert.is_true(run.luarocks_bool("build lualogging"))
60 62
@@ -64,7 +66,6 @@ describe("LuaRocks remove tests #blackbox #b_remove", function()
64 end) 66 end)
65 67
66 it("LuaRocks remove force fast", function() 68 it("LuaRocks remove force fast", function()
67 assert.is_true(test_env.need_luasocket())
68 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) 69 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket"))
69 assert.is_true(run.luarocks_bool("build lualogging")) 70 assert.is_true(run.luarocks_bool("build lualogging"))
70 71