Permalink
Browse files

Tests up and running.

  • Loading branch information...
magnars committed Jun 16, 2012
1 parent 56e0b6e commit e123fabea4561e858b149bc57b01dbe6d1d504e0
Showing with 75 additions and 0 deletions.
  1. +6 −0 .gitmodules
  2. +12 −0 README.md
  3. +1 −0 buster-mode.el
  4. +17 −0 features/buster-mode.feature
  5. +14 −0 features/step-definitions/basic-steps.el
  6. +23 −0 features/support/env.el
  7. +1 −0 util/ecukes
  8. +1 −0 util/espuds
View
@@ -0,0 +1,6 @@
[submodule "util/ecukes"]
path = util/ecukes
url = https://github.com/rejeep/ecukes.git
[submodule "util/espuds"]
path = util/espuds
url = https://github.com/rejeep/espuds.git
View
@@ -8,3 +8,15 @@ with [Buster.js](http://busterjs.org).
All keybindings in buster-mode start with `C-c C-b` and then a two-letter mnemonic shortcut.
* `td`: toggle-deferred will toggle // in the name of the current test.
## Development
To fetch the test dependencies:
$ cd /path/to/buster-mode
$ git submodule init
$ git submodule update
Run the tests with:
$ ./util/ecukes/ecukes features
View
@@ -0,0 +1 @@
(provide 'buster-mode)
@@ -0,0 +1,17 @@
Feature: Toggle deferred
In order to quickly defer a test
As a buster using emacs user
I want to just press key please
Scenario: Deferring a test
When I insert:
"""
buster.testCase('Building Page', {
"contains title after loading page": function () {
assert.match(document.body.innerHTML, "Zombie TDD");
}
});
"""
And I go to the front of the word "assert"
And I press "C-c C-b td"
Then I should see "//contains"
@@ -0,0 +1,14 @@
(When "^I go to character \"\\(.+\\)\"$"
(lambda (char)
(goto-char (point-min))
(let ((search (re-search-forward (format "%s" char) nil t))
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
(assert search nil message char (espuds-buffer-contents)))))
(When "^I go to the \\(front\\|end\\) of the word \"\\(.+\\)\"$"
(lambda (pos word)
(goto-char (point-min))
(let ((search (re-search-forward (format "%s" word) nil t))
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
(assert search nil message word (espuds-buffer-contents))
(if (string-equal "front" pos) (backward-word)))))
View
@@ -0,0 +1,23 @@
(let* ((current-directory (file-name-directory load-file-name))
(features-directory (expand-file-name ".." current-directory))
(project-directory (expand-file-name ".." features-directory)))
(setq buster-mode-root-path project-directory)
(setq buster-mode-util-path (expand-file-name "util" project-directory)))
(add-to-list 'load-path buster-mode-root-path)
(add-to-list 'load-path (expand-file-name "espuds" buster-mode-util-path))
(require 'buster-mode)
(require 'espuds)
(require 'ert)
(Before
(switch-to-buffer
(get-buffer-create "*buster-mode*"))
(erase-buffer)
(transient-mark-mode 1)
(cua-mode 0)
(setq set-mark-default-inactive nil)
(deactivate-mark))
(After)
Submodule ecukes added at 4b30d7
Submodule espuds added at 62ef75

0 comments on commit e123fab

Please sign in to comment.