aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDeepak Singh Rathore <dsrdeepak8@gmail.com>2021-06-23 01:56:56 +0530
committerGitHub <noreply@github.com>2021-06-22 17:26:56 -0300
commita9ea4395bca05516e8297588ec943c648f726345 (patch)
tree2c3106d2841e72acf999a324d84f34ee5f37bb39 /spec
parent7e6bfb6d8c1d45d62ceb4bbe8e89a184d4c96ffb (diff)
downloadluarocks-a9ea4395bca05516e8297588ec943c648f726345.tar.gz
luarocks-a9ea4395bca05516e8297588ec943c648f726345.tar.bz2
luarocks-a9ea4395bca05516e8297588ec943c648f726345.zip
luarocks test: add --prepare flag (#1314)
* Added prepare flag in test command * Added test for prepare flag in spec/test_spec.lua Fixes #1303
Diffstat (limited to 'spec')
-rw-r--r--spec/test_spec.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/test_spec.lua b/spec/test_spec.lua
index 220ae632..943d0e48 100644
--- a/spec/test_spec.lua
+++ b/spec/test_spec.lua
@@ -70,6 +70,32 @@ describe("luarocks test #integration", function()
70 -- Assert that busted ran, whether successfully or not 70 -- Assert that busted ran, whether successfully or not
71 assert.match("%d+ success.* / %d+ failure.* / %d+ error.* / %d+ pending", output) 71 assert.match("%d+ success.* / %d+ failure.* / %d+ error.* / %d+ pending", output)
72 end) 72 end)
73
74 it("prepare", function()
75 finally(function()
76 -- delete downloaded and unpacked files
77 lfs.chdir(testing_paths.testrun_dir)
78 test_env.remove_dir("busted_project-0.1-1")
79 os.remove("busted_project-0.1-1.src.rock")
80 end)
81
82 -- make luassert
83 assert.is_true(run.luarocks_bool("download --server="..testing_paths.fixtures_repo_dir.." busted_project 0.1-1"))
84 assert.is_true(run.luarocks_bool("unpack busted_project-0.1-1.src.rock"))
85 lfs.chdir("busted_project-0.1-1/busted_project")
86 assert.is_true(run.luarocks_bool("make"))
87
88 run.luarocks_bool("remove busted")
89 local prepareOutput = run.luarocks_bool("test --prepare")
90 assert.is_true(run.luarocks_bool("show busted"))
91
92 -- Assert that "test --prepare" run successfully
93 assert.is_true(prepareOutput)
94
95 local output = run.luarocks("test")
96 assert.not_match(tostring(prepareOutput), output)
97
98 end)
73 end) 99 end)
74end) 100end)
75 101