42

GitHub - rejeep/el-mock.el: Mocking library for Emacs

 5 years ago
source link: https://github.com/rejeep/el-mock.el
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

El mock

Build Status Coverage Status MELPA MELPA stable Tag Version License

NOTE: El mock has moved from http://www.emacswiki.org/emacs/el-mock.el to https://github.com/rejeep/el-mock.el and its new maintainer is @rejeep.

El mock is a mocking library for Emacs.

How to use it

Add this to your test-helper, for instance

(require 'el-mock)

An example of a simple mock that displays "/mocked/file/name.el":

(with-mock
  (stub buffer-file-name => "/mocked/file/name.el")
  (display-message-or-buffer (buffer-file-name)))

Documentation

Find the documentation at M-x describe-function RET with-mock RET and M-x describe-function RET mocklet RET.

The old documentation is at https://www.emacswiki.org/emacs/EmacsLispMock

Contribution

Be sure to!

Install Cask if you haven't already.

Run the unit tests with:

$ make test

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK