diff --git a/features/initialization.feature b/features/initialization.feature new file mode 100644 index 00000000..b2e5da37 --- /dev/null +++ b/features/initialization.feature @@ -0,0 +1,8 @@ +Feature: Initialization + + Scenario: read recipes + Given read recipes + + Scenario: package-build initialization + Given initialization + \ No newline at end of file diff --git a/features/step-definitions/melpa-steps.el b/features/step-definitions/melpa-steps.el new file mode 100644 index 00000000..003ee20a --- /dev/null +++ b/features/step-definitions/melpa-steps.el @@ -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)))) diff --git a/features/support/env.el b/features/support/env.el new file mode 100644 index 00000000..ecd7da27 --- /dev/null +++ b/features/support/env.el @@ -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 + ) + diff --git a/run-travis-ci.sh b/run-travis-ci.sh new file mode 100755 index 00000000..7584e8e6 --- /dev/null +++ b/run-travis-ci.sh @@ -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