diff options
Diffstat (limited to '')
-rw-r--r-- | spec/build_spec.lua | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 41c169d9..f0377b5f 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -4,6 +4,7 @@ local get_tmp_path = test_env.get_tmp_path | |||
4 | local run = test_env.run | 4 | local run = test_env.run |
5 | local testing_paths = test_env.testing_paths | 5 | local testing_paths = test_env.testing_paths |
6 | local write_file = test_env.write_file | 6 | local write_file = test_env.write_file |
7 | local git_repo = require("spec.util.git_repo") | ||
7 | 8 | ||
8 | test_env.unload_luarocks() | 9 | test_env.unload_luarocks() |
9 | local cfg = require("luarocks.core.cfg") | 10 | local cfg = require("luarocks.core.cfg") |
@@ -109,12 +110,6 @@ describe("LuaRocks build tests #integration", function() | |||
109 | end, finally) | 110 | end, finally) |
110 | end) | 111 | end) |
111 | 112 | ||
112 | it("LuaRocks build lpeg branch=master", function() | ||
113 | -- FIXME should use dev package | ||
114 | assert.is_true(run.luarocks_bool("build --branch=master lpeg")) | ||
115 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | ||
116 | end) | ||
117 | |||
118 | it("LuaRocks build fails if the deps-mode argument is invalid", function() | 113 | it("LuaRocks build fails if the deps-mode argument is invalid", function() |
119 | assert.is_false(run.luarocks_bool("build --deps-mode=123 " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec")) | 114 | assert.is_false(run.luarocks_bool("build --deps-mode=123 " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec")) |
120 | assert.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/1.0-1/a_rock-1.0-1.rockspec")) | 115 | assert.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/1.0-1/a_rock-1.0-1.rockspec")) |
@@ -928,5 +923,33 @@ describe("LuaRocks build tests #unit", function() | |||
928 | end) | 923 | end) |
929 | end) | 924 | end) |
930 | end) | 925 | end) |
926 | |||
927 | describe("#unix build from #git", function() | ||
928 | local git | ||
929 | |||
930 | setup(function() | ||
931 | git = git_repo.start() | ||
932 | end) | ||
933 | |||
934 | teardown(function() | ||
935 | if git then | ||
936 | git:stop() | ||
937 | end | ||
938 | end) | ||
939 | |||
940 | it("using --branch", function() | ||
941 | write_file("my_branch-1.0-1.rockspec", [[ | ||
942 | rockspec_format = "3.0" | ||
943 | package = "my_branch" | ||
944 | version = "1.0-1" | ||
945 | source = { | ||
946 | url = "git://localhost/testrock" | ||
947 | } | ||
948 | ]], finally) | ||
949 | assert.is_false(run.luarocks_bool("build --branch unknown-branch ./my_branch-1.0-1.rockspec")) | ||
950 | assert.is_true(run.luarocks_bool("build --branch test-branch ./my_branch-1.0-1.rockspec")) | ||
951 | end) | ||
952 | end) | ||
953 | |||
931 | end) | 954 | end) |
932 | 955 | ||