rejeep / ert-runner.el

Opinionated Ert testing workflow
85 stars 19 forks source link

-L option appends instead of prepends path #17

Closed remyhonig closed 9 years ago

remyhonig commented 9 years ago

If I want to use a different version of a package in my tests (in my case I want to use a custom org-mode version) I have to perform some processing of the load-path in my test helper I found out after some debugging.

https://github.com/remyhonig/elfeed-org/blob/master/test/test-helper.el

;; Remove standard org-mode paths so I can supply them with my own
;; using the "cask exec ert-runner -L org-mode/lisp" command
(setq load-path (-remove (lambda (path) (s-ends-with? "lisp/org" path)) load-path))
(message "Org version: %s on Emacs version: %s" (org-version) (emacs-version))

The -L option of ert-runner appends the path and I expected it to work the same way as the -L option of emacs.

https://github.com/rejeep/ert-runner.el/commit/01c94424a63f3d9c2cf7a92265d3a0da3cf26943

But while reading the CHANGELOG for emacs I found out the -L option should prepend to the load-path

http://www.gnu.org/software/emacs/news/NEWS.24.5

** The -L option, which normally prepends its argument to load-path,
will instead append, if the argument begins with `:' (or `;' on MS Windows;
i.e., `path-separator').

My request is to change the behaviour of the -L option to match the one of emacs (so to prepend instead append) . If you don't have the time I'd be happy to provide a PR. Just let me know if you do.

rejeep commented 9 years ago

The -L option for ert runner is actually not related to the Emacs one. Didn't even think about it when I added it. But I still agree with you that it makes more sense to prepend the path. So please go ahead and send a PR with the change and I will merge it!