-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CONTRIBUTING file and hopefully fix elpa.el
The cask package install directory has changed (at least for newer Emacs versions) and no longer includes the micro/build version numbers. elpa.el will be removed entirely after switching to buttercup in the future.
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
* Testing | ||
If you make a PR, please add tests for all added functionality (including tests for known edge cases). In the future I will switch to using buttercup, but lispyville currently uses ERT for testing. | ||
|
||
** Running Tests | ||
To run tests from the command line, first run ~make cask~ and then run ~make test~. ~make cask~ will install dependencies and only needs to be run once for a given Emacs version or when dependencies need to be updated. A specific Emacs version can be used by specifying =EMACS= with the command (e.g. ~EMACS=emacs-25.3 make cask~ and ~EMACS=emacs-25.3 make test~). | ||
|
||
** Writing Tests | ||
For every command added, an ~ert-deftest~ with the same name should be added.The main helper function for writing tests is ~lispyville-with~. ~lispyville-with~ takes an initial string to populate a temporary buffer with. All following arguments after that are functions or keybindings to run in the buffer. It will return the result of running those in the buffer. =|= represents the point and =~= represents the mark. | ||
|
||
#+begin_src emacs-lisp | ||
(ert-deftest forward-word () | ||
;; test that `forward-word' goes to the end of a word | ||
(should (string= (lispyville-with "|foo bar" | ||
(forward-word)) | ||
"foo| bar")) | ||
;; or if the command has a keybinding: | ||
(should (string= (lispyville-with "|foo bar" | ||
"M-f") | ||
"foo| bar"))) | ||
#+end_src | ||
|
||
Please include comments explaining the purpose of your test cases. You can eval your tests in the buffer while writing initially, but please make sure that they pass from ~make test~ as well. | ||
|
||
You can use the command ~lispy-stringify-oneline~ to convert a multi-line sexp or region into a single line suitable for use ~lispyville-with~. | ||
|
||
See the docstring of ~lispyville-with~ and =lispyville-test.el= for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
(setq package-user-dir | ||
(expand-file-name (format ".cask/%s/elpa" | ||
(concat emacs-version | ||
(when (boundp 'emacs-build-number) | ||
(format ".%s" emacs-build-number)))))) | ||
(expand-file-name (format ".cask/%s.%s/elpa" | ||
emacs-major-version | ||
emacs-minor-version))) | ||
(package-initialize) | ||
(add-to-list 'load-path default-directory) |