diff options
| author | Nick Drozd <nicholasdrozd@gmail.com> | 2018-06-14 21:13:22 -0500 |
|---|---|---|
| committer | Bozhidar Batsov <bozhidar.batsov@gmail.com> | 2018-06-16 12:53:27 +0300 |
| commit | bde7d142cdeb97d1bd7d22bc76bf7c8bbed40a85 (patch) | |
| tree | d7b601662ac832c5133c19a2260f4cb1306adf1e | |
| parent | d0b9c329b63571226681f6c52e2d5a17168b94a7 (diff) | |
[Fix #1246] Give clear-known-projects test temp project file
This test was blowing away the actual project file, rather than a test
file. To fix this, move the test to the known-project-test file and
give it test-tmp-file-path.
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | test/.gitignore | 3 | ||||
| -rw-r--r-- | test/projectile-known-project-test.el | 6 | ||||
| -rw-r--r-- | test/projectile-test.el | 7 |
4 files changed, 9 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b14cb17..4d54cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ * [#1011](https://github.com/bbatsov/projectile/issues/1011): Save project files before running project tests. * [#1099](https://github.com/bbatsov/projectile/issues/1099): Fix the behaviour of `projectile-purge-dir-from-cache`. * [#1067](https://github.com/bbatsov/projectile/issues/1067): Don't mess up `default-directory` after switching projects. +* [#1246](https://github.com/bbatsov/projectile/issues/1246): Don't blow away real project file during tests. ## 0.14.0 (2016-07-08) diff --git a/test/.gitignore b/test/.gitignore index 7650738..0a8e3c0 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1 +1,2 @@ -sandbox/
\ No newline at end of file +sandbox/ +tmp/ diff --git a/test/projectile-known-project-test.el b/test/projectile-known-project-test.el index 7b9210f..eb2223e 100644 --- a/test/projectile-known-project-test.el +++ b/test/projectile-known-project-test.el @@ -134,6 +134,12 @@ test temp directory" (when (file-exists-p this-test-file) (delete-file this-test-file))))) +(ert-deftest projectile-clear-known-projects () + (let ((projectile-known-projects '("one" "two" "three")) + (projectile-known-projects-file (projectile-test-tmp-file-path))) + (projectile-clear-known-projects) + (should (null projectile-known-projects)))) + ;; Local Variables: ;; indent-tabs-mode: nil ;; End: diff --git a/test/projectile-test.el b/test/projectile-test.el index 2af6088..09c1d95 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -557,13 +557,6 @@ (re-search-forward sym) (projectile-grep nil ?-))))))))) -;;;;;;;;; fresh tests - -(ert-deftest projectile-clear-known-projects () - (let ((projectile-known-projects '("one" "two" "three"))) - (projectile-clear-known-projects) - (should (null projectile-known-projects)))) - (ert-deftest projectile-switch-project-no-projects () (let ((projectile-known-projects nil)) (should-error (projectile-switch-project)))) |
