add ecukes tests

This commit is contained in:
Donald Curtis 2012-12-30 19:11:40 -06:00
parent 2bc1dc39ad
commit b6d30f4376
4 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,8 @@
Feature: Initialization
Scenario: read recipes
Given read recipes
Scenario: package-build initialization
Given initialization

View file

@ -0,0 +1,22 @@
(Given "^initialization$"
(lambda ()
(package-build-initialize)))
(Given "^read recipes$"
(lambda ()
(pb/read-recipes)))
(Given "^capture messages to \\(.+\\)$"
(lambda (varby)
(message "****** %s" varby)
(collect-messages-to varby)))
(Given "^package initialization$"
(lambda ()
(package-initialize)))
(Then "^\\(.+\\) should be empty"
(lambda (var)
(message "//////// %s" (eval (intern var)))
(let ((varsym (intern var)))
(assert (not (eval varsym)) nil "Variable %s is not empty." var))))

43
features/support/env.el Normal file
View file

@ -0,0 +1,43 @@
;; This is an example of how you could set up this file. This setup
;; requires a directory called util in the project root and that the
;; util directory contains the testing tools ert and espuds.
(let* ((features-directory
(file-name-directory
(directory-file-name (file-name-directory load-file-name))))
(project-directory
(file-name-directory
(directory-file-name features-directory))))
(setq melpa-root-path project-directory)
(setq melpa-util-path (expand-file-name "util" melpa-root-path)))
(add-to-list 'load-path melpa-root-path)
(add-to-list 'load-path (expand-file-name "espuds" melpa-util-path))
(require 'package-build)
(require 'ert)
(require 'espuds)
(Setup
;; Before anything has run
)
(Before
;; Before each scenario is run
(defmacro collect-messages-to (var)
(let ((varsym (intern (eval var))))
(set varsym '())
`(defadvice message (before message (format-string &rest args) activate)
(add-to-list ',varsym (ignore-errors (format format-string args))))
))
)
(After
;; After each scenario is run
)
(Teardown
;; After when everything has been run
)

12
run-travis-ci.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh -e
cd "$(dirname "$0")"
ECUKES_EMACS=${EMACS:-$(which emacs)}
echo "*** Emacs version ***"
echo "ECUKES_EMACS = $ECUKES_EMACS"
"$ECUKES_EMACS" --version
echo
exec ./util/ecukes/ecukes --graphical