Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
EMACS ?= emacs
CASK ?= cask
ELS = phpactor.el company-phpactor.el
AUTOLOADS = phpactor-autoloads.el
ELCS = $(ELS:.el=.elc)

%.elc: %.el
$(EMACS) -Q -batch -L . -f package-initialize -f batch-byte-compile $<

all: clean autoloads $(ELCS)
all: .cask $(ELCS) autoloads

autoloads: $(AUTOLOADS)

Expand All @@ -17,6 +18,17 @@ $(AUTOLOADS): $(ELCS)
(normal-top-level-add-subdirs-to-load-path) \
(package-generate-autoloads \"phpactor\" default-directory))"

.cask: Cask
$(CASK) install

test: .cask $(ELCS)
$(EMACS) -Q -batch -L . --eval \
"(let ((default-directory (expand-file-name \".cask\" default-directory))) \
(normal-top-level-add-subdirs-to-load-path) \
(require 'buttercup))" \
--eval "(setq warning-minimum-log-level :debug)" \
-f buttercup-run-discover

clean:
rm -f $(ELCS) $(AUTOLOADS)

Expand Down
34 changes: 32 additions & 2 deletions tests/e2e/test-sanity.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
;;; test-sanity.el --- Behavior-Driven test for phpactor -*- lexical-binding: t; -*-

;; Copyright (C) 2018 Friends of Emacs-PHP development

;; Author: Mikael Kermorgant <mikael@kgtech.fi>
;; Keywords: maint

;; 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 <https://www.gnu.org/licenses/>.

;;; Commentary:

;; A BDD test code based on Buttercup.
;; https://github.com/jorgenschaefer/emacs-buttercup

;;; Code:
(require 'buttercup)
(require 'phpactor)

(defun buffer-string* (buffer)
Expand All @@ -11,13 +38,13 @@

(describe "var: `phpactor-install-directory'"
(it "should have some value"
(display-warning 'buttercup (format "phpactor install folder is : %s" phpactor-install-directory))
(display-warning 'buttercup (format "phpactor install folder is : %s" phpactor-install-directory) :debug)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

スクリーンショット 2019-06-17 20 07 57

After

スクリーンショット 2019-06-17 20 07 48

(expect phpactor-install-directory :not :to-be nil)
))

(describe ": `phpactor--lisp-directory'" ;; I prefer having a test as I'm not that really fine with it being nil
(it "should have some value"
(display-warning 'buttercup (format "phpactor lisp folder is : %s" phpactor--lisp-directory))
(display-warning 'buttercup (format "phpactor lisp folder is : %s" phpactor--lisp-directory) :debug)
(expect phpactor--lisp-directory :not :to-be nil)
))

Expand All @@ -42,3 +69,6 @@
(expect 'php-project-get-root-dir :to-have-been-called)
)
))

(provide 'test-sanity)
;;; test-sanity.el ends here