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