From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Jorgen Schaefer <forcer@forcix.cx>
Cc: emacs-devel@gnu.org
Subject: Re: Best practice for mocking functions/prompts/etc.
Date: Sun, 09 Nov 2014 01:56:24 +0100 [thread overview]
Message-ID: <m34mu96vk7.fsf@stories.gnus.org> (raw)
In-Reply-To: <20141108193423.4e021283@forcix> (Jorgen Schaefer's message of "Sat, 8 Nov 2014 19:34:23 +0100")
Jorgen Schaefer <forcer@forcix.cx> writes:
> When writing a library for Emacs (to be included in the core), what is
> the recommended best practice to test for interactive function calls? I
> did not see a mock library, so I suspect there is a standard way without
> such a library.
[...]
> (let ((returned-file (the-function)))
>
> (should (equal returned-file test-file))
> (should (equal called-prompt "Foo: ")))))
>
> Is there a better way?
You seem to want to check whether the Emacs Lisp language works at all
by checking a specific function? I don't think that's a useful level to
perform checks at.
I think you can take it as a given that the Emacs Lisp language works as
specified.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2014-11-09 0:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 18:34 Best practice for mocking functions/prompts/etc Jorgen Schaefer
2014-11-08 23:17 ` Nic Ferrier
2014-11-09 8:59 ` Jorgen Schaefer
2014-11-09 10:36 ` Nic Ferrier
2014-11-09 11:05 ` Jorgen Schaefer
2014-11-09 0:56 ` Lars Magne Ingebrigtsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m34mu96vk7.fsf@stories.gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=forcer@forcix.cx \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).