Skip to content

Commit e123fab

Browse files
committed
Tests up and running.
1 parent 56e0b6e commit e123fab

File tree

8 files changed

+75
-0
lines changed

8 files changed

+75
-0
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "util/ecukes"]
2+
path = util/ecukes
3+
url = https://github.com/rejeep/ecukes.git
4+
[submodule "util/espuds"]
5+
path = util/espuds
6+
url = https://github.com/rejeep/espuds.git

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ with [Buster.js](http://busterjs.org).
88
All keybindings in buster-mode start with `C-c C-b` and then a two-letter mnemonic shortcut.
99

1010
* `td`: toggle-deferred will toggle // in the name of the current test.
11+
12+
## Development
13+
14+
To fetch the test dependencies:
15+
16+
$ cd /path/to/buster-mode
17+
$ git submodule init
18+
$ git submodule update
19+
20+
Run the tests with:
21+
22+
$ ./util/ecukes/ecukes features

buster-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(provide 'buster-mode)

features/buster-mode.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Feature: Toggle deferred
2+
In order to quickly defer a test
3+
As a buster using emacs user
4+
I want to just press key please
5+
6+
Scenario: Deferring a test
7+
When I insert:
8+
"""
9+
buster.testCase('Building Page', {
10+
"contains title after loading page": function () {
11+
assert.match(document.body.innerHTML, "Zombie TDD");
12+
}
13+
});
14+
"""
15+
And I go to the front of the word "assert"
16+
And I press "C-c C-b td"
17+
Then I should see "//contains"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(When "^I go to character \"\\(.+\\)\"$"
2+
(lambda (char)
3+
(goto-char (point-min))
4+
(let ((search (re-search-forward (format "%s" char) nil t))
5+
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
6+
(assert search nil message char (espuds-buffer-contents)))))
7+
8+
(When "^I go to the \\(front\\|end\\) of the word \"\\(.+\\)\"$"
9+
(lambda (pos word)
10+
(goto-char (point-min))
11+
(let ((search (re-search-forward (format "%s" word) nil t))
12+
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
13+
(assert search nil message word (espuds-buffer-contents))
14+
(if (string-equal "front" pos) (backward-word)))))

features/support/env.el

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(let* ((current-directory (file-name-directory load-file-name))
2+
(features-directory (expand-file-name ".." current-directory))
3+
(project-directory (expand-file-name ".." features-directory)))
4+
(setq buster-mode-root-path project-directory)
5+
(setq buster-mode-util-path (expand-file-name "util" project-directory)))
6+
7+
(add-to-list 'load-path buster-mode-root-path)
8+
(add-to-list 'load-path (expand-file-name "espuds" buster-mode-util-path))
9+
10+
(require 'buster-mode)
11+
(require 'espuds)
12+
(require 'ert)
13+
14+
(Before
15+
(switch-to-buffer
16+
(get-buffer-create "*buster-mode*"))
17+
(erase-buffer)
18+
(transient-mark-mode 1)
19+
(cua-mode 0)
20+
(setq set-mark-default-inactive nil)
21+
(deactivate-mark))
22+
23+
(After)

util/ecukes

Submodule ecukes added at 4b30d7d

util/espuds

Submodule espuds added at 62ef75c

0 commit comments

Comments
 (0)