Added new surrounder to tests
[elinstall.git] / elinstall / tests.el
blob150d14bab88900fdb91c8c2f618e50e1123f0d44
1 ;;;_ elinstall/tests.el --- Tests for elinstall
3 ;;;_. Headers
4 ;;;_ , License
5 ;; Copyright (C) 2010 Tom Breton (Tehom)
7 ;; Author: Tom Breton (Tehom) <tehom@panix.com>
8 ;; Keywords: lisp, maint, internal
10 ;; This file is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
15 ;; This file is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
25 ;;;_ , Commentary:
27 ;;
30 ;;;_ , Requires
32 (require 'emtest/runner/define)
33 (require 'emtest/testhelp/standard)
34 (progn
35 (eval-when-compile
36 (require 'emtest/testhelp/testpoint/requirer))
37 (emtp:require))
40 ;;;_. Body
41 ;;;_ , Insulation
42 ;;;_ . elinstall:th:surrounders
43 (defconst elinstall:th:surrounders
44 ;;Mock customize-save-variable to do nothing.
45 ;;Also mock interaction: yes-or-no-p. This suggests that I should
46 ;;articulate the package more, to separate interaction.
47 '((emtp:insulate (customize-save-variable)))
48 "The normal surrounders for elinstall tests" )
49 ;;;_ . elinstall:th:insulate-defines
50 (defconst elinstall:th:insulate-defines
51 '((let
52 (a b c d e f)))
54 "Surrounders so that we can define things and still be insulated" )
56 ;;;_ , Tests
57 (emt:deftest-3
58 ((of 'elinstall-already-installed)
59 (:surrounders elinstall:th:surrounders))
61 (nil
62 (let
63 ((elinstall-already-installed nil))
64 (emt:doc "Situation: Nothing has been installed.")
65 (emt:doc "Operation: Query whether EXAMPLE has been installed.")
66 (emt:doc "Response: give nil.")
67 (assert
68 (not
69 (elinstall-already-installed "example")))
71 (emt:doc "Operation: Record that EXAMPLE has been installed.")
73 (elinstall-record-installed "example")
74 (emt:doc "Operation: Query whether EXAMPLE has been installed.")
75 (emt:doc "Response: give true.")
76 (assert
77 (elinstall-already-installed "example")))))
79 ;;;_ , Generating the right actions
81 ;;;_ , Given list of actions, segregate it right.
83 ;;;_ , Given list of actions, doing the right adds to deffile
84 ;;Test by reading stuff back.
86 ;;;_. Footers
87 ;;;_ , Provides
89 (provide 'elinstall/tests)
91 ;;;_ * Local emacs vars.
92 ;;;_ + Local variables:
93 ;;;_ + mode: allout
94 ;;;_ + End:
96 ;;;_ , End
97 ;;; elinstall/tests.el ends here