aboutsummaryrefslogtreecommitdiff
path: root/spec/quick/install.q
diff options
context:
space:
mode:
Diffstat (limited to 'spec/quick/install.q')
-rw-r--r--spec/quick/install.q60
1 files changed, 60 insertions, 0 deletions
diff --git a/spec/quick/install.q b/spec/quick/install.q
index 503aaacc..72795504 100644
--- a/spec/quick/install.q
+++ b/spec/quick/install.q
@@ -415,3 +415,63 @@ STDOUT:
415myrock 1.0-1 is already installed 415myrock 1.0-1 is already installed
416Use --force to reinstall 416Use --force to reinstall
417-------------------------------------------------------------------------------- 417--------------------------------------------------------------------------------
418
419
420
421================================================================================
422TEST: installation rolls back on failure
423
424FILE: myrock-1.0-1.rockspec
425--------------------------------------------------------------------------------
426rockspec_format = "3.0"
427package = "myrock"
428version = "1.0-1"
429source = {
430 url = "file://%{url(tmpdir)}/rock.lua"
431}
432build = {
433 modules = {
434 ["folder.rock"] = "rock.lua",
435 ["xyz"] = "xyz.lua",
436 },
437}
438--------------------------------------------------------------------------------
439
440FILE: rock.lua
441--------------------------------------------------------------------------------
442return {}
443--------------------------------------------------------------------------------
444
445FILE: xyz.lua
446--------------------------------------------------------------------------------
447return {}
448--------------------------------------------------------------------------------
449
450RUN: luarocks make --pack-binary-rock ./myrock-1.0-1.rockspec
451
452FILE: %{testing_sys_tree}/share/lua/%{lua_version}/folder
453--------------------------------------------------------------------------------
454a file where a folder should be
455--------------------------------------------------------------------------------
456
457Try to install and fail because the file is in the folder's spot:
458
459RUN: luarocks install ./myrock-1.0-1.all.rock
460EXIT: 1
461
462EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/folder
463
464No leftovers from the failed installation:
465
466NOT_EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/xyz.lua
467
468Now we remove the file...
469
470RM: %{testing_sys_tree}/share/lua/%{lua_version}/folder
471
472Try again and succeed:
473
474RUN: luarocks install ./myrock-1.0-1.all.rock
475
476EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/folder/rock.lua
477EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/xyz.lua