diff options
Diffstat (limited to 'spec/install_spec.lua')
-rw-r--r-- | spec/install_spec.lua | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 77ac6225..3b0b22fb 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
@@ -3,8 +3,8 @@ local lfs = require("lfs") | |||
3 | local run = test_env.run | 3 | local run = test_env.run |
4 | local testing_paths = test_env.testing_paths | 4 | local testing_paths = test_env.testing_paths |
5 | local env_variables = test_env.env_variables | 5 | local env_variables = test_env.env_variables |
6 | local get_tmp_path = test_env.get_tmp_path | ||
7 | local write_file = test_env.write_file | 6 | local write_file = test_env.write_file |
7 | local git_repo = require("spec.util.git_repo") | ||
8 | 8 | ||
9 | test_env.unload_luarocks() | 9 | test_env.unload_luarocks() |
10 | 10 | ||
@@ -234,4 +234,31 @@ describe("luarocks install #integration", function() | |||
234 | end) | 234 | end) |
235 | end) | 235 | end) |
236 | 236 | ||
237 | describe("#unix install runs build from #git", function() | ||
238 | local git | ||
239 | |||
240 | setup(function() | ||
241 | git = git_repo.start() | ||
242 | end) | ||
243 | |||
244 | teardown(function() | ||
245 | if git then | ||
246 | git:stop() | ||
247 | end | ||
248 | end) | ||
249 | |||
250 | it("using --branch", function() | ||
251 | write_file("my_branch-1.0-1.rockspec", [[ | ||
252 | rockspec_format = "3.0" | ||
253 | package = "my_branch" | ||
254 | version = "1.0-1" | ||
255 | source = { | ||
256 | url = "git://localhost/testrock" | ||
257 | } | ||
258 | ]], finally) | ||
259 | assert.is_false(run.luarocks_bool("install --branch unknown-branch ./my_branch-1.0-1.rockspec")) | ||
260 | assert.is_true(run.luarocks_bool("install --branch test-branch ./my_branch-1.0-1.rockspec")) | ||
261 | end) | ||
262 | end) | ||
263 | |||
237 | end) | 264 | end) |