[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Best practice for mocking functions/prompts/etc.
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: Best practice for mocking functions/prompts/etc. |
Date: |
Sun, 09 Nov 2014 01:56:24 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) |
Jorgen Schaefer <address@hidden> 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