diff options
Diffstat (limited to 'spec/build_spec.lua')
| -rw-r--r-- | spec/build_spec.lua | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 3b33a1aa..5e78aa4f 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
| @@ -49,45 +49,7 @@ describe("LuaRocks build #integration", function() | |||
| 49 | test_env.setup_specs(extra_rocks) | 49 | test_env.setup_specs(extra_rocks) |
| 50 | end) | 50 | end) |
| 51 | 51 | ||
| 52 | describe("basic testing set", function() | ||
| 53 | it("invalid", function() | ||
| 54 | assert.is_false(run.luarocks_bool("build invalid")) | ||
| 55 | end) | ||
| 56 | |||
| 57 | it("with no arguments behaves as luarocks make", function() | ||
| 58 | test_env.run_in_tmp(function(tmpdir) | ||
| 59 | write_file("c_module-1.0-1.rockspec", [[ | ||
| 60 | package = "c_module" | ||
| 61 | version = "1.0-1" | ||
| 62 | source = { | ||
| 63 | url = "http://example.com/c_module" | ||
| 64 | } | ||
| 65 | build = { | ||
| 66 | type = "builtin", | ||
| 67 | modules = { | ||
| 68 | c_module = { "c_module.c" } | ||
| 69 | } | ||
| 70 | } | ||
| 71 | ]], finally) | ||
| 72 | write_file("c_module.c", c_module_source, finally) | ||
| 73 | |||
| 74 | assert.is_true(run.luarocks_bool("build")) | ||
| 75 | assert.truthy(lfs.attributes(tmpdir .. "/c_module." .. test_env.lib_extension)) | ||
| 76 | end, finally) | ||
| 77 | end) | ||
| 78 | end) | ||
| 79 | |||
| 80 | describe("building with flags", function() | 52 | describe("building with flags", function() |
| 81 | it("fails if it doesn't have the permissions to access the specified tree #unix", function() | ||
| 82 | assert.is_false(run.luarocks_bool("build --tree=/usr " .. testing_paths.fixtures_dir .. "/a_rock-1.0.1-rockspec")) | ||
| 83 | assert.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/1.0-1/a_rock-1.0-1.rockspec")) | ||
| 84 | end) | ||
| 85 | |||
| 86 | it("fails if it doesn't have the permissions to access the specified tree's parent #unix", function() | ||
| 87 | assert.is_false(run.luarocks_bool("build --tree=/usr/invalid " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec")) | ||
| 88 | assert.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/1.0-1/a_rock-1.0-1.rockspec")) | ||
| 89 | end) | ||
| 90 | |||
| 91 | it("verbose", function() | 53 | it("verbose", function() |
| 92 | test_env.run_in_tmp(function(tmpdir) | 54 | test_env.run_in_tmp(function(tmpdir) |
| 93 | write_file("test-1.0-1.rockspec", [[ | 55 | write_file("test-1.0-1.rockspec", [[ |
| @@ -429,7 +391,7 @@ describe("LuaRocks build #integration", function() | |||
| 429 | package = "a_rock" | 391 | package = "a_rock" |
| 430 | version = "1.0-1" | 392 | version = "1.0-1" |
| 431 | source = { | 393 | source = { |
| 432 | url = "file://]] .. testing_paths.fixtures_dir .. [[/a_rock.lua" | 394 | url = "file://]] .. testing_paths.fixtures_dir:gsub("\\", "/") .. [[/a_rock.lua" |
| 433 | } | 395 | } |
| 434 | description = { | 396 | description = { |
| 435 | summary = "An example rockspec", | 397 | summary = "An example rockspec", |
