aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2018-10-07 12:03:37 +0300
committerBozhidar Batsov <bozhidar@batsov.com>2018-10-07 12:03:37 +0300
commit883eb4683fd607f276d68308e13380d090a19175 (patch)
tree1897941c833e8a7a66da4068d2135119450d9620 /test
parentcdef222eff9ce034ed0984543332ad6f0bc3c7e2 (diff)
[Fix #1315] Give preference to the project types registered last
We used to keep the project types in a hash table and we didn't have guarantees about the order in which they its keys would be returned (or at least I don't think we had), so I've opted to them in an alist instead. Now newer registrations take precedence when doing project type look-up.
Diffstat (limited to 'test')
-rw-r--r--test/projectile-test.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/projectile-test.el b/test/projectile-test.el
index e8438f7..04dffa8 100644
--- a/test/projectile-test.el
+++ b/test/projectile-test.el
@@ -87,6 +87,13 @@ test temp directory"
(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-register-project-type"
+ (it "prepends new projects to projectile-project-types"
+ (projectile-register-project-type 'foo '("Foo"))
+ (expect (caar projectile-project-types) :to-equal 'foo)
+ (projectile-register-project-type 'bar '("Bar"))
+ (expect (caar projectile-project-types) :to-equal 'bar)))
+
(describe "projectile-get-all-sub-projects"
(it "excludes out-of-project submodules"
(projectile-test-with-sandbox