aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortoshokan <toshokan@shojigate.net>2022-11-12 11:37:59 -0500
committerBozhidar Batsov <bozhidar@batsov.dev>2022-11-18 12:35:49 +0200
commit1654956cfed4691f3e9553d91e573efe0be8646a (patch)
tree314967831c71fafb4e8781b59cbc58e08d8e6a59 /test
parent7d414ea3421689a766383b03e566c5399419c566 (diff)
Allow multiple project-files per type and wildcards in project-files
Diffstat (limited to 'test')
-rw-r--r--test/projectile-test.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/projectile-test.el b/test/projectile-test.el
index de89580..a6e4e91 100644
--- a/test/projectile-test.el
+++ b/test/projectile-test.el
@@ -165,6 +165,25 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'.
(expect (projectile-expand-root "foo/bar") :to-equal "/path/to/project/foo/bar")
(expect (projectile-expand-root "./foo/bar") :to-equal "/path/to/project/foo/bar")))
+(describe "projectile-expand-file-name-wildcard"
+ (it "expands a filename not containing wildcards"
+ (expect (projectile-expand-file-name-wildcard "test" "/path/to/project/")
+ :to-equal "/path/to/project/test"))
+ (it "does not try to resolve wildcards if there are none in the pattern"
+ (spy-on 'file-expand-wildcards)
+ (expect (projectile-expand-file-name-wildcard "foo" "/path/to/project/")
+ :to-equal "/path/to/project/foo")
+ (expect (spy-calls-any 'file-expand-wildcards) :to-equal nil))
+ (it "returns the first wildcard result if any exist"
+ (spy-on 'file-expand-wildcards
+ :and-return-value '("/path/to/project/one"
+ "/path/to/project/two"))
+ (expect (projectile-expand-file-name-wildcard "*" "/path/to/project")
+ :to-equal "/path/to/project/one"))
+ (it "returns the expanded result if the are no wildcard results"
+ (expect (projectile-expand-file-name-wildcard "*" "/path/to/project-b")
+ :to-equal "/path/to/project-b/*")))
+
(describe "projectile--combine-plists"
(it "Items in second plist override elements in first"
(expect (projectile--combine-plists