Skip to content

Commit

Permalink
Create a buster minor-mode to keep our keybinding in.
Browse files Browse the repository at this point in the history
  • Loading branch information
magnars committed Jun 16, 2012
1 parent f3fe2dd commit e83c319
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
12 changes: 11 additions & 1 deletion buster-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
(delete-char 2)
(insert "//")))

(global-set-key (kbd "C-c C-b td") 'buster-toggle-deffered)
(defvar buster-mode-map (make-sparse-keymap)
"buster-mode keymap")

(define-key buster-mode-map
(kbd "C-c C-b td") 'buster-toggle-deffered)

(define-minor-mode buster-mode
"Buster mode"
nil
" Buster"
buster-mode-map)

(provide 'buster-mode)
16 changes: 16 additions & 0 deletions features/buster-mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ Feature: Toggle deferred
"""
And I go to the front of the word "assert"
And I press "C-c C-b td"
Then I should not see "//contains"

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 turn on buster-mode
And I go to the front of the word "assert"
And I press "C-c C-b td"
Then I should see "//contains"

Scenario: Undeferring a test
Expand All @@ -25,6 +39,7 @@ Feature: Toggle deferred
}
});
"""
And I turn on buster-mode
And I go to the front of the word "assert"
And I press "C-c C-b td"
Then I should not see "//contains"
Expand All @@ -38,6 +53,7 @@ Feature: Toggle deferred
}
});
"""
And I turn on buster-mode
And I go to the front of the word "assert"
And I press "C-c C-b td"
Then I should see "'//contains"
1 change: 1 addition & 0 deletions features/support/env.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
(erase-buffer)
(transient-mark-mode 1)
(cua-mode 0)
(buster-mode 0)
(setq set-mark-default-inactive nil)
(deactivate-mark))

Expand Down

0 comments on commit e83c319

Please sign in to comment.