diff options
author | roboo <robo.karasek@gmail.com> | 2016-07-19 22:56:28 +0200 |
---|---|---|
committer | roboo <robo.karasek@gmail.com> | 2016-07-19 22:56:28 +0200 |
commit | 3945f90b0bd80024294b048a793bae526cad30e2 (patch) | |
tree | c7658afc65573b60db6f94e0f4c9cbcb6fada343 /spec | |
parent | 2af8f114097b2e79d7f92f9b0cea4cacdc2ff853 (diff) | |
download | luarocks-3945f90b0bd80024294b048a793bae526cad30e2.tar.gz luarocks-3945f90b0bd80024294b048a793bae526cad30e2.tar.bz2 luarocks-3945f90b0bd80024294b048a793bae526cad30e2.zip |
Test improvements
Diffstat (limited to 'spec')
-rw-r--r-- | spec/build_spec.lua | 36 | ||||
-rw-r--r-- | spec/help_spec.lua | 6 | ||||
-rw-r--r-- | spec/install_spec.lua | 12 | ||||
-rw-r--r-- | spec/make_spec.lua | 10 | ||||
-rw-r--r-- | spec/pack_spec.lua | 6 | ||||
-rw-r--r-- | spec/remove_spec.lua | 2 | ||||
-rw-r--r-- | spec/search_spec.lua | 6 | ||||
-rw-r--r-- | spec/upload_spec.lua | 6 | ||||
-rw-r--r-- | spec/util_spec.lua | 13 | ||||
-rw-r--r-- | spec/write_rockspec_spec.lua | 3 |
10 files changed, 49 insertions, 51 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 682c6dcf..2ede5211 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -57,7 +57,7 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
57 | end) | 57 | end) |
58 | 58 | ||
59 | it("LuaRocks build lpeg verbose", function() | 59 | it("LuaRocks build lpeg verbose", function() |
60 | assert.is_true(run.luarocks_bool("build --verbose lpeg")) | 60 | assert.is.truthy(run.luarocks("build --verbose lpeg")) |
61 | end) | 61 | end) |
62 | 62 | ||
63 | it("LuaRocks build lpeg branch=master", function() | 63 | it("LuaRocks build lpeg branch=master", function() |
@@ -82,9 +82,8 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
82 | end) | 82 | end) |
83 | 83 | ||
84 | describe("LuaRocks build - basic builds", function() | 84 | describe("LuaRocks build - basic builds", function() |
85 | |||
86 | it("LuaRocks build luadoc", function() | 85 | it("LuaRocks build luadoc", function() |
87 | assert.is_true(run.luarocks_bool("build luadoc")) | 86 | assert.is_true(run.luarocks_bool(test_env.quiet("build luadoc"))) |
88 | end) | 87 | end) |
89 | 88 | ||
90 | it("LuaRocks build luacov diff version", function() | 89 | it("LuaRocks build luacov diff version", function() |
@@ -103,12 +102,12 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
103 | end) | 102 | end) |
104 | 103 | ||
105 | it("LuaRocks build supported platforms lpty", function() | 104 | it("LuaRocks build supported platforms lpty", function() |
106 | assert.is_true(run.luarocks_bool("build lpty")) | 105 | assert.is_true(run.luarocks_bool(test_env.quiet("build lpty"))) |
107 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpty")) | 106 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpty")) |
108 | end) | 107 | end) |
109 | 108 | ||
110 | it("LuaRocks build luasec with skipping dependency checks", function() | 109 | it("LuaRocks build luasec with skipping dependency checks", function() |
111 | assert.is_true(run.luarocks_bool("build luasec --nodeps")) | 110 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --nodeps"))) |
112 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) | 111 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) |
113 | end) | 112 | end) |
114 | 113 | ||
@@ -119,31 +118,34 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
119 | end) | 118 | end) |
120 | 119 | ||
121 | describe("LuaRocks build - more complex tests", function() | 120 | describe("LuaRocks build - more complex tests", function() |
122 | 121 | if test_env.TYPE_TEST_ENV == "full" then | |
123 | it("LuaRocks build luacheck show downloads test_config", function() | 122 | it("LuaRocks build luacheck show downloads test_config", function() |
124 | local out = run.luarocks("build luacheck", { LUAROCKS_CONFIG = testing_paths.testing_dir .. "/testing_config_show_downloads.lua"} ) | 123 | local output = run.luarocks("build luacheck", { LUAROCKS_CONFIG = testing_paths.testing_dir .. "/testing_config_show_downloads.lua"} ) |
125 | print(out) | 124 | assert.is.truthy(output:match("%.%.%.")) |
126 | end) | 125 | end) |
127 | 126 | end | |
127 | |||
128 | it("LuaRocks build luasec only deps", function() | 128 | it("LuaRocks build luasec only deps", function() |
129 | assert.is_true(run.luarocks_bool("build luasec --only-deps")) | 129 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --only-deps"))) |
130 | assert.is_false(run.luarocks_bool("show luasec")) | 130 | assert.is_false(run.luarocks_bool("show luasec")) |
131 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) | 131 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) |
132 | end) | 132 | end) |
133 | 133 | ||
134 | it("LuaRocks build only deps of downloaded rockspec of lxsh", function() | 134 | it("LuaRocks build only deps of downloaded rockspec of lxsh", function() |
135 | assert.is_true(run.luarocks_bool("download --rockspec lxsh 0.8.6-2")) | 135 | assert.is_true(run.luarocks_bool("download --rockspec lxsh 0.8.6-2")) |
136 | assert.is_true(run.luarocks_bool("build lxsh-0.8.6-2.rockspec --only-deps")) | 136 | assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.rockspec --only-deps")) |
137 | assert.is_false(run.luarocks_bool("show lxsh")) | 137 | assert.is_false(run.luarocks_bool("show lxsh")) |
138 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 138 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) |
139 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | ||
139 | assert.is_true(os.remove("lxsh-0.8.6-2.rockspec")) | 140 | assert.is_true(os.remove("lxsh-0.8.6-2.rockspec")) |
140 | end) | 141 | end) |
141 | 142 | ||
142 | it("LuaRocks build only deps of downloaded rock of lxsh", function() | 143 | it("LuaRocks build only deps of downloaded rock of lxsh", function() |
143 | assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6-2")) | 144 | assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6-2")) |
144 | assert.is_true(run.luarocks_bool("build lxsh-0.8.6-2.src.rock --only-deps")) | 145 | assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.src.rock --only-deps")) |
145 | assert.is_false(run.luarocks_bool("show lxsh")) | 146 | assert.is_false(run.luarocks_bool("show lxsh")) |
146 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 147 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) |
148 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | ||
147 | assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) | 149 | assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) |
148 | end) | 150 | end) |
149 | 151 | ||
@@ -151,7 +153,7 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
151 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) | 153 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) |
152 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) | 154 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) |
153 | 155 | ||
154 | assert.is_true(run.luarocks_bool("show validate-args")) | 156 | assert.is.truthy(run.luarocks("show validate-args")) |
155 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) | 157 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) |
156 | 158 | ||
157 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) | 159 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) |
@@ -159,10 +161,10 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
159 | 161 | ||
160 | it("LuaRocks build with https", function() | 162 | it("LuaRocks build with https", function() |
161 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) | 163 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) |
162 | assert.is_true(run.luarocks_bool("install luasec")) | 164 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) |
163 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) | 165 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) |
164 | 166 | ||
165 | assert.is_true(run.luarocks_bool("show validate-args")) | 167 | assert.is.truthy(run.luarocks("show validate-args")) |
166 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) | 168 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) |
167 | 169 | ||
168 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) | 170 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) |
diff --git a/spec/help_spec.lua b/spec/help_spec.lua index 0d41e2e9..88aa5030 100644 --- a/spec/help_spec.lua +++ b/spec/help_spec.lua | |||
@@ -10,7 +10,7 @@ describe("LuaRocks help tests #blackbox #b_help", function() | |||
10 | end) | 10 | end) |
11 | 11 | ||
12 | it("LuaRocks help with no flags/arguments", function() | 12 | it("LuaRocks help with no flags/arguments", function() |
13 | assert.is_true(run.luarocks_bool("help")) | 13 | assert.is_true(run.luarocks_bool(test_env.quiet("help"))) |
14 | end) | 14 | end) |
15 | 15 | ||
16 | it("LuaRocks help invalid argument", function() | 16 | it("LuaRocks help invalid argument", function() |
@@ -18,10 +18,10 @@ describe("LuaRocks help tests #blackbox #b_help", function() | |||
18 | end) | 18 | end) |
19 | 19 | ||
20 | it("LuaRocks help config", function() | 20 | it("LuaRocks help config", function() |
21 | assert.is_true(run.luarocks_bool("help config")) | 21 | assert.is_true(run.luarocks_bool(test_env.quiet("help config"))) |
22 | end) | 22 | end) |
23 | 23 | ||
24 | it("LuaRocks-admin help with no flags/arguments", function() | 24 | it("LuaRocks-admin help with no flags/arguments", function() |
25 | assert.is_true(run.luarocks_admin_bool("help")) | 25 | assert.is_true(run.luarocks_admin_bool(test_env.quiet("help"))) |
26 | end) | 26 | end) |
27 | end) | 27 | end) |
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 28e349c3..bd480c21 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
@@ -73,31 +73,31 @@ describe("LuaRocks install tests #blackbox #b_install", function() | |||
73 | 73 | ||
74 | describe("LuaRocks install - more complex tests", function() | 74 | describe("LuaRocks install - more complex tests", function() |
75 | it('LuaRocks install luasec with skipping dependency checks', function() | 75 | it('LuaRocks install luasec with skipping dependency checks', function() |
76 | run.luarocks(" install luasec --nodeps") | 76 | run.luarocks_bool(test_env.quiet(" install luasec --nodeps")) |
77 | assert.is_true(run.luarocks_bool("show luasec")) | 77 | assert.is_true(run.luarocks_bool(test_env.quiet("show luasec"))) |
78 | if env_variables.TYPE_TEST_ENV == "minimal" then | 78 | if env_variables.TYPE_TEST_ENV == "minimal" then |
79 | assert.is_false(run.luarocks_bool("show luasocket")) | 79 | assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) |
80 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) | 80 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) |
81 | end | 81 | end |
82 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) | 82 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) |
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(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-1")) | 86 | assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock luasocket 3.0rc1-1"))) |
87 | local output = run.luarocks("install --only-deps " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock") | 87 | local output = run.luarocks("install --only-deps " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock") |
88 | assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1") | 88 | assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1") |
89 | assert.is_true(os.remove("luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) | 89 | assert.is_true(os.remove("luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) |
90 | end) | 90 | end) |
91 | 91 | ||
92 | it("LuaRocks install reinstall", function() | 92 | it("LuaRocks install reinstall", function() |
93 | assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-1")) | 93 | assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock luasocket 3.0rc1-1"))) |
94 | assert.is_true(run.luarocks_bool("install " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) | 94 | assert.is_true(run.luarocks_bool("install " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) |
95 | assert.is_true(run.luarocks_bool("install --deps-mode=none " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) | 95 | assert.is_true(run.luarocks_bool("install --deps-mode=none " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) |
96 | assert.is_true(os.remove("luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) | 96 | assert.is_true(os.remove("luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) |
97 | end) | 97 | end) |
98 | 98 | ||
99 | it("LuaRocks install binary rock of cprint", function() | 99 | it("LuaRocks install binary rock of cprint", function() |
100 | assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) | 100 | assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock cprint"))) |
101 | assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock")) | 101 | assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock")) |
102 | assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")) | 102 | assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")) |
103 | end) | 103 | end) |
diff --git a/spec/make_spec.lua b/spec/make_spec.lua index 3e843f7b..e684033a 100644 --- a/spec/make_spec.lua +++ b/spec/make_spec.lua | |||
@@ -30,10 +30,10 @@ describe("LuaRocks make tests #blackbox #b_make", function() | |||
30 | assert.is_true(run.luarocks_bool("download --source luasocket 3.0rc1-1")) | 30 | assert.is_true(run.luarocks_bool("download --source luasocket 3.0rc1-1")) |
31 | assert.is_true(run.luarocks_bool("unpack luasocket-3.0rc1-1.src.rock")) | 31 | assert.is_true(run.luarocks_bool("unpack luasocket-3.0rc1-1.src.rock")) |
32 | lfs.chdir("luasocket-3.0rc1-1/luasocket-3.0-rc1/") | 32 | lfs.chdir("luasocket-3.0rc1-1/luasocket-3.0-rc1/") |
33 | assert.is_true(run.luarocks_bool("make luasocket-3.0rc1-1.rockspec")) | 33 | assert.is_true(run.luarocks_bool(test_env.quiet("make luasocket-3.0rc1-1.rockspec"))) |
34 | 34 | ||
35 | -- test it | 35 | -- test it |
36 | assert.is_true(run.luarocks_bool("show luasocket")) | 36 | assert.is_true(run.luarocks_bool(test_env.quiet("show luasocket"))) |
37 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) | 37 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasocket")) |
38 | 38 | ||
39 | -- delete downloaded and unpacked files | 39 | -- delete downloaded and unpacked files |
@@ -61,7 +61,7 @@ describe("LuaRocks make tests #blackbox #b_make", function() | |||
61 | assert.is_true(run.luarocks_bool("new_version lxsh-0.8.6-2.rockspec")) | 61 | assert.is_true(run.luarocks_bool("new_version lxsh-0.8.6-2.rockspec")) |
62 | assert.is_true(run.luarocks_bool("make")) | 62 | assert.is_true(run.luarocks_bool("make")) |
63 | 63 | ||
64 | assert.is_true(run.luarocks_bool("show lxsh")) | 64 | assert.is_true(run.luarocks_bool(test_env.quiet("show lxsh"))) |
65 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 65 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) |
66 | end) | 66 | end) |
67 | 67 | ||
@@ -69,7 +69,7 @@ describe("LuaRocks make tests #blackbox #b_make", function() | |||
69 | os.execute("cp lxsh-0.8.6-2.rockspec rockspec") --rewrite with lfs | 69 | os.execute("cp lxsh-0.8.6-2.rockspec rockspec") --rewrite with lfs |
70 | assert.is_true(run.luarocks_bool("make")) | 70 | assert.is_true(run.luarocks_bool("make")) |
71 | 71 | ||
72 | assert.is_true(run.luarocks_bool("show lxsh")) | 72 | assert.is_true(run.luarocks_bool(test_env.quiet("show lxsh"))) |
73 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 73 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) |
74 | end) | 74 | end) |
75 | 75 | ||
@@ -91,7 +91,7 @@ describe("LuaRocks make tests #blackbox #b_make", function() | |||
91 | end) | 91 | end) |
92 | 92 | ||
93 | it("LuaRocks make pack binary rock", function() | 93 | it("LuaRocks make pack binary rock", function() |
94 | assert.is_true(run.luarocks_bool("make --deps-mode=none --pack-binary-rock")) | 94 | assert.is_true(run.luarocks_bool(test_env.quiet("make --deps-mode=none --pack-binary-rock"))) |
95 | assert.is.truthy(lfs.attributes("lxsh-0.8.6-2.all.rock")) | 95 | assert.is.truthy(lfs.attributes("lxsh-0.8.6-2.all.rock")) |
96 | end) | 96 | end) |
97 | end) | 97 | end) |
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index 78aab9aa..0e5b31c6 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua | |||
@@ -24,8 +24,7 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() | |||
24 | end) | 24 | end) |
25 | 25 | ||
26 | it("LuaRocks pack basic", function() | 26 | it("LuaRocks pack basic", function() |
27 | assert.is_true(run.luarocks_bool("list")) | 27 | assert.is_true(run.luarocks_bool(test_env.quiet("pack luacov"))) |
28 | assert.is_true(run.luarocks_bool("pack luacov")) | ||
29 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luacov-")) | 28 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luacov-")) |
30 | end) | 29 | end) |
31 | 30 | ||
@@ -49,9 +48,8 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() | |||
49 | assert.is_false(run.luarocks_bool("pack say")) | 48 | assert.is_false(run.luarocks_bool("pack say")) |
50 | end) | 49 | end) |
51 | 50 | ||
52 | |||
53 | it("LuaRocks pack src", function() | 51 | it("LuaRocks pack src", function() |
54 | assert.is_true(run.luarocks_bool("install luasec")) | 52 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) |
55 | assert.is_true(run.luarocks_bool("download --rockspec luasocket 3.0rc1-1")) | 53 | assert.is_true(run.luarocks_bool("download --rockspec luasocket 3.0rc1-1")) |
56 | assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-1.rockspec")) | 54 | assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-1.rockspec")) |
57 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-")) | 55 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-")) |
diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua index c7f83b95..7bf1bb10 100644 --- a/spec/remove_spec.lua +++ b/spec/remove_spec.lua | |||
@@ -45,7 +45,7 @@ describe("LuaRocks remove tests #blackbox #b_remove", function() | |||
45 | 45 | ||
46 | describe("LuaRocks remove more complex tests", function() | 46 | describe("LuaRocks remove more complex tests", function() |
47 | before_each(function() | 47 | before_each(function() |
48 | assert.is_true(test_env.need_rock("luasocket")) | 48 | assert.is.truthy(test_env.need_rock("luasocket")) |
49 | end) | 49 | end) |
50 | 50 | ||
51 | it("LuaRocks remove fail, break dependencies", function() | 51 | it("LuaRocks remove fail, break dependencies", function() |
diff --git a/spec/search_spec.lua b/spec/search_spec.lua index 33c49856..b31624b8 100644 --- a/spec/search_spec.lua +++ b/spec/search_spec.lua | |||
@@ -30,11 +30,7 @@ describe("LuaRocks search tests #blackbox #b_search", function() | |||
30 | end) | 30 | end) |
31 | 31 | ||
32 | it("LuaRocks search with flag all", function() | 32 | it("LuaRocks search with flag all", function() |
33 | assert.is_true(run.luarocks_bool("search --all")) | 33 | assert.is_true(run.luarocks_bool(test_env.quiet("search --all"))) |
34 | end) | 34 | end) |
35 | 35 | ||
36 | it("LuaRocks search zlib", function() | ||
37 | local num = 123 | ||
38 | assert.is_true(run.luarocks_bool("search " .. num)) | ||
39 | end) | ||
40 | end) | 36 | end) |
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index 02b68611..c68a1cdf 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua | |||
@@ -53,7 +53,7 @@ describe("LuaRocks upload tests #blackbox #b_upload", function() | |||
53 | 53 | ||
54 | describe("LuaRocks upload tests with Xavante server #mock", function() | 54 | describe("LuaRocks upload tests with Xavante server #mock", function() |
55 | before_each(function() | 55 | before_each(function() |
56 | assert.is_true(test_env.need_rock("restserver-xavante")) | 56 | assert.is.truthy(test_env.need_rock("restserver-xavante")) |
57 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables) | 57 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables) |
58 | os.execute(final_command) | 58 | os.execute(final_command) |
59 | end) | 59 | end) |
@@ -63,10 +63,10 @@ describe("LuaRocks upload tests #blackbox #b_upload", function() | |||
63 | end) | 63 | end) |
64 | 64 | ||
65 | it("LuaRocks upload rockspec with api-key", function() | 65 | it("LuaRocks upload rockspec with api-key", function() |
66 | assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-1.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | 66 | assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) |
67 | end) | 67 | end) |
68 | it("LuaRocks upload rockspec with api-key and skip-pack", function() | 68 | it("LuaRocks upload rockspec with api-key and skip-pack", function() |
69 | assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-1.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | 69 | assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) |
70 | end) | 70 | end) |
71 | end) | 71 | end) |
72 | end) | 72 | end) |
diff --git a/spec/util_spec.lua b/spec/util_spec.lua index 9118ffc9..23e3ebd8 100644 --- a/spec/util_spec.lua +++ b/spec/util_spec.lua | |||
@@ -34,13 +34,16 @@ describe("Basic tests #blackbox #b_util", function() | |||
34 | local delete_path = lfs.currentdir() | 34 | local delete_path = lfs.currentdir() |
35 | assert.is_true(os.remove(delete_path)) | 35 | assert.is_true(os.remove(delete_path)) |
36 | 36 | ||
37 | assert.is_false(run.luarocks_bool(" ")) | 37 | local output = run.luarocks("") |
38 | assert.is.falsy(output:find("LuaRocks scm, a module deployment system for Lua")) | ||
38 | assert.is_true(lfs.chdir(main_path)) | 39 | assert.is_true(lfs.chdir(main_path)) |
39 | assert.is_true(run.luarocks_bool(" ")) | 40 | |
41 | output = run.luarocks("") | ||
42 | assert.is.truthy(output:find("LuaRocks scm, a module deployment system for Lua")) | ||
40 | end) | 43 | end) |
41 | 44 | ||
42 | it("LuaRocks timeout", function() | 45 | it("LuaRocks timeout", function() |
43 | assert.is_true(run.luarocks_bool("--timeout=10")) | 46 | assert.is.truthy(run.luarocks("--timeout=10")) |
44 | end) | 47 | end) |
45 | 48 | ||
46 | it("LuaRocks timeout invalid", function() | 49 | it("LuaRocks timeout invalid", function() |
@@ -48,7 +51,7 @@ describe("Basic tests #blackbox #b_util", function() | |||
48 | end) | 51 | end) |
49 | 52 | ||
50 | it("LuaRocks only server=testing", function() | 53 | it("LuaRocks only server=testing", function() |
51 | assert.is_true(run.luarocks_bool("--only-server=testing")) | 54 | assert.is.truthy(run.luarocks("--only-server=testing")) |
52 | end) | 55 | end) |
53 | 56 | ||
54 | it("LuaRocks test site config", function() | 57 | it("LuaRocks test site config", function() |
@@ -56,7 +59,7 @@ describe("Basic tests #blackbox #b_util", function() | |||
56 | assert.is.falsy(lfs.attributes("src/luarocks/site_config.lua")) | 59 | assert.is.falsy(lfs.attributes("src/luarocks/site_config.lua")) |
57 | assert.is.truthy(lfs.attributes("src/luarocks/site_config.lua.tmp")) | 60 | assert.is.truthy(lfs.attributes("src/luarocks/site_config.lua.tmp")) |
58 | 61 | ||
59 | assert.is_true(run.luarocks_bool("")) | 62 | assert.is.truthy(run.luarocks("")) |
60 | 63 | ||
61 | assert.is.truthy(os.rename("src/luarocks/site_config.lua.tmp", "src/luarocks/site_config.lua")) | 64 | assert.is.truthy(os.rename("src/luarocks/site_config.lua.tmp", "src/luarocks/site_config.lua")) |
62 | assert.is.falsy(lfs.attributes("src/luarocks/site_config.lua.tmp")) | 65 | assert.is.falsy(lfs.attributes("src/luarocks/site_config.lua.tmp")) |
diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua index 85e345d5..531d11eb 100644 --- a/spec/write_rockspec_spec.lua +++ b/spec/write_rockspec_spec.lua | |||
@@ -64,8 +64,7 @@ describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() | |||
64 | end) | 64 | end) |
65 | 65 | ||
66 | it("LuaRocks write_rockspec git luafcgi with many flags", function() | 66 | it("LuaRocks write_rockspec git luafcgi with many flags", function() |
67 | assert.is_true(run.luarocks_bool("write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license=\"3-clause BSD\" " | 67 | assert.is_true(run.luarocks_bool("write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license=\"3-clause BSD\" " .. "--lua-version=5.1,5.2")) |
68 | .. "--lua-version=5.1,5.2")) | ||
69 | assert.is.truthy(lfs.attributes("luafcgi-scm-1.rockspec")) -- TODO maybe read it content and find arguments from flags? | 68 | assert.is.truthy(lfs.attributes("luafcgi-scm-1.rockspec")) -- TODO maybe read it content and find arguments from flags? |
70 | assert.is_true(os.remove("luafcgi-scm-1.rockspec")) | 69 | assert.is_true(os.remove("luafcgi-scm-1.rockspec")) |
71 | end) | 70 | end) |