diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2020-02-13 12:41:57 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2020-02-13 12:43:00 -0300 |
commit | 5620d3b00c7defcbcbcfcb2a42401a0f567ad30a (patch) | |
tree | 40788fd0b0476e9224ee353496f5f998c208528e /spec | |
parent | a7eba5be6c85d35bcca7c5cb4f9f923a0fa2a4d9 (diff) | |
download | luarocks-5620d3b00c7defcbcbcfcb2a42401a0f567ad30a.tar.gz luarocks-5620d3b00c7defcbcbcfcb2a42401a0f567ad30a.tar.bz2 luarocks-5620d3b00c7defcbcbcfcb2a42401a0f567ad30a.zip |
show: accept a substring when unambiguous and matches a single entry
Diffstat (limited to 'spec')
-rw-r--r-- | spec/show_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/show_spec.lua b/spec/show_spec.lua index a0987de0..c2840d29 100644 --- a/spec/show_spec.lua +++ b/spec/show_spec.lua | |||
@@ -78,6 +78,17 @@ describe("LuaRocks show #integration", function() | |||
78 | run.luarocks_bool("show luacov 0.13.0") | 78 | run.luarocks_bool("show luacov 0.13.0") |
79 | end) | 79 | end) |
80 | 80 | ||
81 | it("can find by substring", function() | ||
82 | assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
83 | assert.match("a_build_dep", run.luarocks("show has_")) | ||
84 | end) | ||
85 | |||
86 | it("fails when substring matches multiple", function() | ||
87 | assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
88 | assert(run.luarocks_bool("install a_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
89 | assert.match("multiple installed packages match the name 'dep'", run.luarocks("show dep")) | ||
90 | end) | ||
91 | |||
81 | it("shows #build_dependencies", function() | 92 | it("shows #build_dependencies", function() |
82 | assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | 93 | assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) |
83 | assert.match("a_build_dep", run.luarocks("show has_build_dep")) | 94 | assert.match("a_build_dep", run.luarocks("show has_build_dep")) |