Permalink
Browse files

move elnode-db test stuff to separate file for bootstrapping reasons

  • Loading branch information...
1 parent e886520 commit 28842afcc5332e7a01f92cc6fd620f6688b8299f nferrier committed Jul 5, 2012
Showing with 69 additions and 10 deletions.
  1. +66 −0 elnode-db-tests.el
  2. +0 −10 elnode-db.el
  3. +3 −0 packagedir.el
View
@@ -0,0 +1,66 @@
+;;; elnode-db.el --- a database interface -*- lexical-binding: t -*-
+
+;; Copyright (C) 2012 Nic Ferrier
+
+;; Author: Nic Ferrier <nferrier@ferrier.me.uk>
+;; Maintainer: Nic Ferrier <nferrier@ferrier.me.uk>
+;; Created: 30 June 2012
+;; Keywords: lisp, http, hypermedia
+
+;; This file is NOT part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; These are the tests for elnode-db.
+;;
+;; elnode-db needs it's own tests because elnode-db is a depend of
+;; elnode itself and thus it gets loaded before elnode. If it did not
+;; have it's own tests it would cause a dependancy on ERT for all of
+;; elnode.
+
+;;; Source code
+;;
+;; elnode's code can be found here:
+;; http://github.com/nicferrier/elnode
+
+;;; Style note
+;;
+;; This codes uses the Emacs style of:
+;;
+;; elnode--private-function
+;;
+;; for private functions.
+
+
+;;; Code:
+
+(require 'ert)
+(require 'elnode-db)
+
+(ert-deftest elnode-db-get ()
+ "Test the database interface and the hash implementation."
+ ;; Make a hash-db with no filename
+ (let ((db (elnode-db-make '(elnode-db-hash))))
+ (should-not (elnode-db-get "test-key" db))
+ (elnode-db-put "test-key" 321 db)
+ (should
+ (equal
+ 321
+ (elnode-db-get "test-key" db)))))
+
+(provide 'elnode-db-tests)
+
+;;; elnode-db-tests.el ends here
View
@@ -136,16 +136,6 @@ If the filename exists then it is loaded into the database."
(elnode-db-hash--save db)
v))
-(ert-deftest elnode-db-get ()
- ;; Make a hash-db with no filename
- (let ((db (elnode-db-make '(elnode-db-hash))))
- (should-not (elnode-db-get "test-key" db))
- (elnode-db-put "test-key" 321 db)
- (should
- (equal
- 321
- (elnode-db-get "test-key" db)))))
-
(provide 'elnode-db)
;;; elnode-db.el ends here
View
@@ -11,9 +11,12 @@
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")))
(load-file "build.el")
+(message "requiring for tests")
+(require 'elnode-db)
(require 'elnode-wiki)
(require 'elnode-tests)
(require 'elnode-client)
+;;(ert "elnode-client-http-post")
(ert-run-tests-batch-and-exit)
;; End

0 comments on commit 28842af

Please sign in to comment.