aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-04-02 13:12:17 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-04-11 14:38:06 -0300
commitfa3f92059c51cbcdf26df9a010f5eadd11a9567d (patch)
treeb5d63cef8464be6cd98d33575f6fa6220413f87a /spec
parent4941a48407f08544c5517542ffc11b0c26fd4236 (diff)
downloadluarocks-fa3f92059c51cbcdf26df9a010f5eadd11a9567d.tar.gz
luarocks-fa3f92059c51cbcdf26df9a010f5eadd11a9567d.tar.bz2
luarocks-fa3f92059c51cbcdf26df9a010f5eadd11a9567d.zip
Tests: add test for namespaced install
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/a_repo/a_rock-1.0-1.rockspec17
-rw-r--r--spec/fixtures/a_repo/a_rock-1.0-1.src.rockbin0 -> 446 bytes
-rw-r--r--spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.rockspec19
-rw-r--r--spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.src.rockbin0 -> 603 bytes
-rw-r--r--spec/fixtures/a_repo/has_namespaced_dep-1.0-1.rockspec19
-rw-r--r--spec/fixtures/a_repo/has_namespaced_dep-1.0-1.src.rockbin0 -> 580 bytes
-rw-r--r--spec/fixtures/a_repo/manifest14
-rw-r--r--spec/fixtures/a_repo/manifest-5.114
-rw-r--r--spec/fixtures/a_repo/manifest-5.214
-rw-r--r--spec/fixtures/a_repo/manifest-5.314
-rw-r--r--spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.rockspec17
-rw-r--r--spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.src.rockbin0 -> 446 bytes
-rw-r--r--spec/fixtures/a_repo/manifests/a_user/manifest14
-rw-r--r--spec/fixtures/a_repo/manifests/a_user/manifest-5.114
-rw-r--r--spec/fixtures/a_repo/manifests/a_user/manifest-5.214
-rw-r--r--spec/fixtures/a_repo/manifests/a_user/manifest-5.314
-rw-r--r--spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.rockspec17
-rw-r--r--spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.src.rockbin0 -> 449 bytes
-rw-r--r--spec/fixtures/a_repo/manifests/another_user/manifest14
-rw-r--r--spec/fixtures/a_repo/manifests/another_user/manifest-5.114
-rw-r--r--spec/fixtures/a_repo/manifests/another_user/manifest-5.214
-rw-r--r--spec/fixtures/a_repo/manifests/another_user/manifest-5.314
-rw-r--r--spec/install_spec.lua58
23 files changed, 290 insertions, 25 deletions
diff --git a/spec/fixtures/a_repo/a_rock-1.0-1.rockspec b/spec/fixtures/a_repo/a_rock-1.0-1.rockspec
new file mode 100644
index 00000000..9f15e87a
--- /dev/null
+++ b/spec/fixtures/a_repo/a_rock-1.0-1.rockspec
@@ -0,0 +1,17 @@
1package = "a_rock"
2version = "1.0-1"
3source = {
4 url = "http://localhost:8080/file/a_rock.lua"
5}
6description = {
7 summary = "An example rockspec",
8}
9dependencies = {
10 "lua >= 5.1"
11}
12build = {
13 type = "builtin",
14 modules = {
15 build = "a_rock.lua"
16 },
17}
diff --git a/spec/fixtures/a_repo/a_rock-1.0-1.src.rock b/spec/fixtures/a_repo/a_rock-1.0-1.src.rock
new file mode 100644
index 00000000..9d0bb455
--- /dev/null
+++ b/spec/fixtures/a_repo/a_rock-1.0-1.src.rock
Binary files differ
diff --git a/spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.rockspec b/spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.rockspec
new file mode 100644
index 00000000..04cb06cf
--- /dev/null
+++ b/spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.rockspec
@@ -0,0 +1,19 @@
1rockspec_format = "3.0"
2package = "has_another_namespaced_dep"
3version = "1.0-1"
4source = {
5 url = "http://localhost:8080/file/a_rock.lua"
6}
7description = {
8 summary = "An example rockspec",
9}
10dependencies = {
11 "another_user/a_rock",
12 "lua >= 5.1",
13}
14build = {
15 type = "builtin",
16 modules = {
17 bla = "a_rock.lua"
18 },
19}
diff --git a/spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.src.rock b/spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.src.rock
new file mode 100644
index 00000000..4bbbf1a6
--- /dev/null
+++ b/spec/fixtures/a_repo/has_another_namespaced_dep-1.0-1.src.rock
Binary files differ
diff --git a/spec/fixtures/a_repo/has_namespaced_dep-1.0-1.rockspec b/spec/fixtures/a_repo/has_namespaced_dep-1.0-1.rockspec
new file mode 100644
index 00000000..6152c78d
--- /dev/null
+++ b/spec/fixtures/a_repo/has_namespaced_dep-1.0-1.rockspec
@@ -0,0 +1,19 @@
1rockspec_format = "3.0"
2package = "has_namespaced_dep"
3version = "1.0-1"
4source = {
5 url = "http://localhost:8080/file/a_rock.lua"
6}
7description = {
8 summary = "An example rockspec",
9}
10dependencies = {
11 "a_user/a_rock",
12 "lua >= 5.1",
13}
14build = {
15 type = "builtin",
16 modules = {
17 bla = "a_rock.lua"
18 },
19}
diff --git a/spec/fixtures/a_repo/has_namespaced_dep-1.0-1.src.rock b/spec/fixtures/a_repo/has_namespaced_dep-1.0-1.src.rock
new file mode 100644
index 00000000..c4d5f94a
--- /dev/null
+++ b/spec/fixtures/a_repo/has_namespaced_dep-1.0-1.src.rock
Binary files differ
diff --git a/spec/fixtures/a_repo/manifest b/spec/fixtures/a_repo/manifest
new file mode 100644
index 00000000..ea198207
--- /dev/null
+++ b/spec/fixtures/a_repo/manifest
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["1.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifest-5.1 b/spec/fixtures/a_repo/manifest-5.1
new file mode 100644
index 00000000..ea198207
--- /dev/null
+++ b/spec/fixtures/a_repo/manifest-5.1
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["1.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifest-5.2 b/spec/fixtures/a_repo/manifest-5.2
new file mode 100644
index 00000000..ea198207
--- /dev/null
+++ b/spec/fixtures/a_repo/manifest-5.2
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["1.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifest-5.3 b/spec/fixtures/a_repo/manifest-5.3
new file mode 100644
index 00000000..ea198207
--- /dev/null
+++ b/spec/fixtures/a_repo/manifest-5.3
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["1.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.rockspec b/spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.rockspec
new file mode 100644
index 00000000..da5a9a10
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.rockspec
@@ -0,0 +1,17 @@
1package = "a_rock"
2version = "2.0-1"
3source = {
4 url = "http://localhost:8080/file/a_rock.lua"
5}
6description = {
7 summary = "An example rockspec",
8}
9dependencies = {
10 "lua >= 5.1"
11}
12build = {
13 type = "builtin",
14 modules = {
15 build = "a_rock.lua"
16 },
17}
diff --git a/spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.src.rock b/spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.src.rock
new file mode 100644
index 00000000..8d10fac1
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/a_user/a_rock-2.0-1.src.rock
Binary files differ
diff --git a/spec/fixtures/a_repo/manifests/a_user/manifest b/spec/fixtures/a_repo/manifests/a_user/manifest
new file mode 100644
index 00000000..74b0c618
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/a_user/manifest
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["2.0-1"] = {
6 {
7 arch = "rockspec"
8 },
9 {
10 arch = "src"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/a_user/manifest-5.1 b/spec/fixtures/a_repo/manifests/a_user/manifest-5.1
new file mode 100644
index 00000000..74b0c618
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/a_user/manifest-5.1
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["2.0-1"] = {
6 {
7 arch = "rockspec"
8 },
9 {
10 arch = "src"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/a_user/manifest-5.2 b/spec/fixtures/a_repo/manifests/a_user/manifest-5.2
new file mode 100644
index 00000000..74b0c618
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/a_user/manifest-5.2
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["2.0-1"] = {
6 {
7 arch = "rockspec"
8 },
9 {
10 arch = "src"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/a_user/manifest-5.3 b/spec/fixtures/a_repo/manifests/a_user/manifest-5.3
new file mode 100644
index 00000000..74b0c618
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/a_user/manifest-5.3
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["2.0-1"] = {
6 {
7 arch = "rockspec"
8 },
9 {
10 arch = "src"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.rockspec b/spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.rockspec
new file mode 100644
index 00000000..628c5a43
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.rockspec
@@ -0,0 +1,17 @@
1package = "a_rock"
2version = "3.0-1"
3source = {
4 url = "http://localhost:8080/file/a_rock.lua"
5}
6description = {
7 summary = "An example rockspec",
8}
9dependencies = {
10 "lua >= 5.1"
11}
12build = {
13 type = "builtin",
14 modules = {
15 a_rock = "a_rock.lua"
16 },
17}
diff --git a/spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.src.rock b/spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.src.rock
new file mode 100644
index 00000000..4c20afc4
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/another_user/a_rock-3.0-1.src.rock
Binary files differ
diff --git a/spec/fixtures/a_repo/manifests/another_user/manifest b/spec/fixtures/a_repo/manifests/another_user/manifest
new file mode 100644
index 00000000..185aed08
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/another_user/manifest
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["3.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/another_user/manifest-5.1 b/spec/fixtures/a_repo/manifests/another_user/manifest-5.1
new file mode 100644
index 00000000..185aed08
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/another_user/manifest-5.1
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["3.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/another_user/manifest-5.2 b/spec/fixtures/a_repo/manifests/another_user/manifest-5.2
new file mode 100644
index 00000000..185aed08
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/another_user/manifest-5.2
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["3.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/fixtures/a_repo/manifests/another_user/manifest-5.3 b/spec/fixtures/a_repo/manifests/another_user/manifest-5.3
new file mode 100644
index 00000000..185aed08
--- /dev/null
+++ b/spec/fixtures/a_repo/manifests/another_user/manifest-5.3
@@ -0,0 +1,14 @@
1commands = {}
2modules = {}
3repository = {
4 a_rock = {
5 ["3.0-1"] = {
6 {
7 arch = "src"
8 },
9 {
10 arch = "rockspec"
11 }
12 }
13 }
14}
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index d72d88ba..53c8f0d0 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -27,58 +27,66 @@ local extra_rocks = {
27 "/sailor-0.5-4.src.rock", 27 "/sailor-0.5-4.src.rock",
28} 28}
29 29
30describe("LuaRocks install tests #blackbox #b_install", function() 30describe("luarocks install #blackbox #b_install", function()
31 31
32 before_each(function() 32 before_each(function()
33 test_env.setup_specs(extra_rocks) 33 test_env.setup_specs(extra_rocks)
34 end) 34 end)
35 35
36 describe("LuaRocks install - basic tests", function() 36 describe("basic tests", function()
37 it("LuaRocks install with no flags/arguments", function() 37 it("fails with no flags/arguments", function()
38 assert.is_false(run.luarocks_bool("install")) 38 assert.is_false(run.luarocks_bool("install"))
39 end) 39 end)
40 40
41 it("LuaRocks install with invalid argument", function() 41 it("fails with invalid argument", function()
42 assert.is_false(run.luarocks_bool("install invalid")) 42 assert.is_false(run.luarocks_bool("install invalid"))
43 end) 43 end)
44 44
45 it("LuaRocks install invalid patch", function() 45 it("fails invalid patch", function()
46 assert.is_false(run.luarocks_bool("install " .. testing_paths.fixtures_dir .. "/invalid_patch-0.1-1.rockspec")) 46 assert.is_false(run.luarocks_bool("install " .. testing_paths.fixtures_dir .. "/invalid_patch-0.1-1.rockspec"))
47 end) 47 end)
48 48
49 it("LuaRocks install invalid rock", function() 49 it("fails invalid rock", function()
50 assert.is_false(run.luarocks_bool("install \"invalid.rock\" ")) 50 assert.is_false(run.luarocks_bool("install \"invalid.rock\" "))
51 end) 51 end)
52 52
53 it("LuaRocks install with local flag as root #unix", function() 53 it("fails with local flag as root #unix", function()
54 assert.is_false(run.luarocks_bool("install --local luasocket ", { USER = "root" } )) 54 assert.is_false(run.luarocks_bool("install --local luasocket ", { USER = "root" } ))
55 end) 55 end)
56 56
57 it("LuaRocks install not a zip file", function() 57 it("fails not a zip file", function()
58 assert.is_false(run.luarocks_bool("install " .. testing_paths.fixtures_dir .. "/not_a_zipfile-1.0-1.src.rock")) 58 assert.is_false(run.luarocks_bool("install " .. testing_paths.fixtures_dir .. "/not_a_zipfile-1.0-1.src.rock"))
59 end) 59 end)
60 60
61 it("LuaRocks install only-deps of lxsh show there is no lxsh", function() 61 it("only-deps of lxsh show there is no lxsh", function()
62 assert.is_true(run.luarocks_bool("install lxsh 0.8.6-2 --only-deps")) 62 assert.is_true(run.luarocks_bool("install lxsh 0.8.6-2 --only-deps"))
63 assert.is_false(run.luarocks_bool("show lxsh")) 63 assert.is_false(run.luarocks_bool("show lxsh"))
64 end) 64 end)
65 65
66 it("LuaRocks install incompatible architecture", function() 66 it("fails with incompatible architecture", function()
67 assert.is_false(run.luarocks_bool("install \"foo-1.0-1.impossible-x86.rock\" ")) 67 assert.is_false(run.luarocks_bool("install \"foo-1.0-1.impossible-x86.rock\" "))
68 end) 68 end)
69 69
70 it("LuaRocks install wsapi with bin", function() 70 it("installs a package with an executable", function()
71 run.luarocks_bool("install wsapi") 71 assert(run.luarocks_bool("install wsapi"))
72 end) 72 end)
73 73
74 it("LuaRocks install luasec and show luasocket (dependency)", function() 74 it("installs a package with a dependency", function()
75 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS)) 75 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS))
76 assert.is_true(run.luarocks_bool("show luasocket")) 76 assert.is_true(run.luarocks_bool("show luasocket"))
77 end) 77 end)
78 end) 78 end)
79
80 describe("#only namespaced packages", function()
81 it("installs a namespaced package from the command-line", function()
82 assert(run.luarocks_bool("install a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" ))
83 assert.is_false(run.luarocks_bool("show a_rock 1.0"))
84 assert(run.luarocks_bool("show a_rock 2.0"))
85 end)
86 end)
79 87
80 describe("LuaRocks install - more complex tests", function() 88 describe("more complex tests", function()
81 it('LuaRocks install luasec with skipping dependency checks', function() 89 it('luasec with skipping dependency checks', function()
82 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS .. " --nodeps")) 90 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS .. " --nodeps"))
83 assert.is_true(run.luarocks_bool("show luasec")) 91 assert.is_true(run.luarocks_bool("show luasec"))
84 if env_variables.TYPE_TEST_ENV == "minimal" then 92 if env_variables.TYPE_TEST_ENV == "minimal" then
@@ -88,7 +96,7 @@ describe("LuaRocks install tests #blackbox #b_install", function()
88 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec")) 96 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec"))
89 end) 97 end)
90 98
91 it('LuaRocks install - handle relative path in --tree #632', function() 99 it('handle relative path in --tree #632', function()
92 local relative_path = "./temp_dir_"..math.random(100000) 100 local relative_path = "./temp_dir_"..math.random(100000)
93 if test_env.TEST_TARGET_OS == "windows" then 101 if test_env.TEST_TARGET_OS == "windows" then
94 relative_path = relative_path:gsub("/", "\\") 102 relative_path = relative_path:gsub("/", "\\")
@@ -101,7 +109,7 @@ describe("LuaRocks install tests #blackbox #b_install", function()
101 assert.is.falsy(lfs.attributes(relative_path)) 109 assert.is.falsy(lfs.attributes(relative_path))
102 end) 110 end)
103 111
104 it('LuaRocks install - handle versioned modules when installing another version with --keep #268', function() 112 it('handle versioned modules when installing another version with --keep #268', function()
105 assert.is_true(run.luarocks_bool("install luafilesystem")) 113 assert.is_true(run.luarocks_bool("install luafilesystem"))
106 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) 114 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension))
107 115
@@ -114,7 +122,7 @@ describe("LuaRocks install tests #blackbox #b_install", function()
114 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_3_1-lfs."..test_env.lib_extension)) 122 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_3_1-lfs."..test_env.lib_extension))
115 end) 123 end)
116 124
117 it('LuaRocks install - handle versioned modules and commands from different files when upgrading #302', function() 125 it('handle versioned modules and commands from different files when upgrading #302', function()
118 io.open(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension, "w"):close() 126 io.open(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension, "w"):close()
119 assert.is_true(run.luarocks_bool("install luacheck 0.7.3 --deps-mode=none")) 127 assert.is_true(run.luarocks_bool("install luacheck 0.7.3 --deps-mode=none"))
120 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck.lua")) 128 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck.lua"))
@@ -134,7 +142,7 @@ describe("LuaRocks install tests #blackbox #b_install", function()
134 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck_0_7_3_1-luacheck"..test_env.wrapper_extension)) 142 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck_0_7_3_1-luacheck"..test_env.wrapper_extension))
135 end) 143 end)
136 144
137 it('LuaRocks install - handle non-Lua files in build.install.lua when upgrading sailorproject/sailor#138', function() 145 it('handle non-Lua files in build.install.lua when upgrading sailorproject/sailor#138', function()
138 assert.is_true(run.luarocks_bool("install sailor 0.5-3 --deps-mode=none")) 146 assert.is_true(run.luarocks_bool("install sailor 0.5-3 --deps-mode=none"))
139 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) 147 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess"))
140 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) 148 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~"))
@@ -144,21 +152,21 @@ describe("LuaRocks install tests #blackbox #b_install", function()
144 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) 152 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~"))
145 end) 153 end)
146 154
147 it("LuaRocks install only-deps of luasocket packed rock", function() 155 it("only-deps of luasocket packed rock", function()
148 assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2")) 156 assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2"))
149 local output = run.luarocks("install --only-deps " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock") 157 local output = run.luarocks("install --only-deps " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock")
150 assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-2") 158 assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-2")
151 assert.is_true(os.remove("luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) 159 assert.is_true(os.remove("luasocket-3.0rc1-2." .. test_env.platform .. ".rock"))
152 end) 160 end)
153 161
154 it("LuaRocks install reinstall", function() 162 it("reinstall", function()
155 assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2")) 163 assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2"))
156 assert.is_true(run.luarocks_bool("install " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) 164 assert.is_true(run.luarocks_bool("install " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock"))
157 assert.is_true(run.luarocks_bool("install --deps-mode=none " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) 165 assert.is_true(run.luarocks_bool("install --deps-mode=none " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock"))
158 assert.is_true(os.remove("luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) 166 assert.is_true(os.remove("luasocket-3.0rc1-2." .. test_env.platform .. ".rock"))
159 end) 167 end)
160 168
161 it("LuaRocks install binary rock of cprint", function() 169 it("binary rock of cprint", function()
162 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) 170 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint"))
163 assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock")) 171 assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock"))
164 assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")) 172 assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock"))
@@ -166,20 +174,20 @@ describe("LuaRocks install tests #blackbox #b_install", function()
166 end) 174 end)
167 175
168 describe("New install functionality based on pull request 552", function() 176 describe("New install functionality based on pull request 552", function()
169 it("LuaRocks install break dependencies warning", function() 177 it("break dependencies warning", function()
170 assert.is_true(run.luarocks_bool("install say 1.2")) 178 assert.is_true(run.luarocks_bool("install say 1.2"))
171 assert.is_true(run.luarocks_bool("install luassert")) 179 assert.is_true(run.luarocks_bool("install luassert"))
172 assert.is_true(run.luarocks_bool("install say 1.0")) 180 assert.is_true(run.luarocks_bool("install say 1.0"))
173 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.2-1")) 181 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.2-1"))
174 end) 182 end)
175 it("LuaRocks install break dependencies force", function() 183 it("break dependencies force", function()
176 assert.is_true(run.luarocks_bool("install say 1.2")) 184 assert.is_true(run.luarocks_bool("install say 1.2"))
177 assert.is_true(run.luarocks_bool("install luassert")) 185 assert.is_true(run.luarocks_bool("install luassert"))
178 local output = run.luarocks("install --force say 1.0") 186 local output = run.luarocks("install --force say 1.0")
179 assert.is.truthy(output:find("Checking stability of dependencies")) 187 assert.is.truthy(output:find("Checking stability of dependencies"))
180 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.2-1")) 188 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.2-1"))
181 end) 189 end)
182 it("LuaRocks install break dependencies force fast", function() 190 it("break dependencies force fast", function()
183 assert.is_true(run.luarocks_bool("install say 1.2")) 191 assert.is_true(run.luarocks_bool("install say 1.2"))
184 assert.is_true(run.luarocks_bool("install luassert")) 192 assert.is_true(run.luarocks_bool("install luassert"))
185 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.2-1")) 193 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.2-1"))