Permalink
Browse files

#46 fix the autoload problem, ALSO move elnode-db to external depend.

  • Loading branch information...
1 parent ada0624 commit 59a74c1684d601ffd41e90d33fcec0088bfd2522 @nicferrier committed Oct 6, 2012
Showing with 16 additions and 396 deletions.
  1. +1 −1 Makefile
  2. +0 −2 build-parts.txt
  3. +0 −132 elnode-db-tests.el
  4. +0 −249 elnode-db.el
  5. +3 −2 elnode-wiki.el
  6. +11 −9 elnode.el
  7. +1 −1 requirements.txt
View
@@ -2,7 +2,7 @@
# These are the variables that are specific to the package
NAME=elnode
-VERSION=0.9.9.5
+VERSION=0.9.9.6
DOC="A simple event handling HTTP server."
# Everything beyond here should be generic
View
@@ -1,8 +1,6 @@
elnode.el
elnode-tests.el
elnode-rle.el
-elnode-db.el
-elnode-db-tests.el
elnode-wiki.el
default-wiki-index.creole
default-webserver-test.html
View
@@ -1,132 +0,0 @@
-;;; 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.
-
-;; This code originated from this gmane thread:
-;; http://permalink.gmane.org/gmane.emacs.devel/115821 by Thierry Volpiatto
-
-;;; 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:
-
-(eval-when-compile (require 'cl))
-(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)))))
-
-(ert-deftest elnode-db-put ()
- "Test the put interface."
- (let ((db (elnode-db-make '(elnode-db-hash))))
- (should-not (elnode-db-get "test-key" db))
- (should
- (equal
- '("1" "2" "3")
- (elnode-db-put "test-key" '("1" "2" "3") db)))))
-
-(ert-deftest elnode-db-hash--save ()
- "Test the saving of a hash db."
- (unwind-protect
- (progn
- (let ((db (elnode-db-make
- ;; You shouldn't use an extension but let elnode deal
- ;; with it.
- '(elnode-db-hash :filename "/tmp/elnode-test-db"))))
- ;; Override the save so it does nothing from put
- (flet ((elnode-db-hash--save (db)
- t))
- (elnode-db-put 'test1 "value1" db)
- (elnode-db-put 'test2 "value2" db))
- ;; And now save
- (elnode-db-hash--save db))
- ;; And now load in a different scope
- (let ((db (elnode-db-make
- '(elnode-db-hash :filename "/tmp/elnode-test-db"))))
- (should
- (equal "value1"
- (elnode-db-get 'test1 db)))))
- (delete-file "/tmp/elnode-test-db.elc")))
-
-(ert-deftest elnode-db-filter ()
- "Test the filtering."
- (let ((db (elnode-db-make
- '(elnode-db-hash :filename "/tmp/elnode-test-db"))))
- (elnode-db-put
- "test001"
- '(("uid" . "test001")
- ("fullname" . "test user 1"))
- db)
- (elnode-db-put
- "test002"
- '(("uid" . "test002")
- ("fullname" . "test user 2"))
- db)
- (elnode-db-put
- "test003"
- '(("uid" . "test001")
- ("fullname" . "test user 1"))
- db)
- (flet ((filt (key value)
- (cdr (assoc "fullname" value))))
- (let ((filtered
- (elnode-db-make
- `(elnode-db-filter
- :source ,db
- :filter filt))))
- (plist-get filtered :source)
- (should
- (equal (elnode-db-get "test002" filtered) "test user 2"))))))
-
-(provide 'elnode-db-tests)
-
-;;; elnode-db-tests.el ends here
Oops, something went wrong.

0 comments on commit 59a74c1

Please sign in to comment.