Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These are the first tests that define changes from ert to ecukes. We intend to use ecukes from now on and also try to set up virtual environments for these tests. (Related: #16)
- Loading branch information
1 parent
cb5fc59
commit f8a5068
Showing
4 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Feature: Importmagic can start | ||
|
||
Scenario: importmagic-mode can start | ||
When I turn on python-mode | ||
And I turn on importmagic-mode | ||
Then importmagic-server should be up | ||
|
||
Scenario: importmagic uses python as interpreter and starts correctly | ||
Given I set importmagic-python-interpreter to "python" | ||
When I turn on python-mode | ||
And I turn on importmagic-mode | ||
Then importmagic-server should be up | ||
|
||
Scenario: importmagic does not start on fundamental-mode | ||
Given buffer is in fundamental-mode | ||
When I try to turn on importmagic-mode | ||
Then importmagic-server should not be up | ||
|
||
Scenario: importmagic doesn't start in c-mode | ||
Given buffer is in c-mode | ||
When I try to turn on importmagic-mode | ||
Then importmagic-server should not be up | ||
|
||
|
||
Scenario: importmagic can't start without importmagic-mode off but python-mode on | ||
When I turn on python-mode | ||
Then importmagic-server should not be up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
;; This file contains your project specific step definitions. All | ||
;; files in this directory whose names end with "-steps.el" will be | ||
;; loaded automatically by Ecukes. | ||
|
||
(When "^I try to turn on importmagic-mode$" | ||
(lambda () | ||
(ignore-errors | ||
(importmagic-mode)))) | ||
|
||
(Given "^buffer is in \\(.+\\)$" | ||
(lambda (mode) | ||
(ignore-errors | ||
(importmagic-mode)))) | ||
(Given "^buffer is in \\(.+\\)$" | ||
"Turns on some mode." | ||
(lambda (mode) | ||
(let ((v (vconcat [?\C-u ?\M-x] (string-to-vector mode)))) | ||
(execute-kbd-macro v)))) | ||
|
||
(Then "^importmagic-server should be up$" | ||
"Asserts that importmagic-server is not nil" | ||
(lambda () | ||
(let ((message "Expected `importmagic-server' to be non-nil, but it was nil.")) | ||
(cl-assert importmagic-server nil message)))) | ||
|
||
(Then "^importmagic-server should not be up$" | ||
"Asserts that importmagic-server is nil" | ||
(lambda () | ||
(let ((message "Expected `importmagic-server' to be nil, but it was not nil.")) | ||
(cl-assert (not importmagic-server) nil message)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(require 'f) | ||
|
||
(defvar importmagic.el-support-path | ||
(f-dirname load-file-name)) | ||
|
||
(defvar importmagic.el-features-path | ||
(f-parent importmagic.el-support-path)) | ||
|
||
(defvar importmagic.el-root-path | ||
(f-parent importmagic.el-features-path)) | ||
|
||
(add-to-list 'load-path importmagic.el-root-path) | ||
|
||
;; Ensure that we don't load old byte-compiled versions | ||
(let ((load-prefer-newer t)) | ||
(require 'importmagic) | ||
(require 'espuds) | ||
(require 'ert)) | ||
|
||
(Setup) | ||
|
||
(Before | ||
(switch-to-buffer | ||
(get-buffer-create "*importmagic*")) | ||
(erase-buffer) | ||
(fundamental-mode) | ||
(cua-mode 0) | ||
(transient-mark-mode t) | ||
(deactivate-mark) | ||
) | ||
|
||
(After) | ||
|
||
(Teardown) |