branch: elpa/multiple-cursors
commit 4c56cb8b78fe1f5141b4786644cc4cbc7af243d2
Author: Magnar Sveen <[email protected]>
Commit: Magnar Sveen <[email protected]>
Tests for white-list prompt.
---
features/multiple-cursors-core.feature | 14 ++++++++++++++
features/step-definitions/multiple-cursors-steps.el | 12 ++++++++++++
2 files changed, 26 insertions(+)
diff --git a/features/multiple-cursors-core.feature
b/features/multiple-cursors-core.feature
index 7bbd007..62ebccf 100644
--- a/features/multiple-cursors-core.feature
+++ b/features/multiple-cursors-core.feature
@@ -43,6 +43,20 @@ Feature: Multiple cursors core
And I type ")"
Then I should see "This (text contains) the word (text twice)"
+ Scenario: Unknown command: yes, do for all
+ Given I have bound C-! to a new command that inserts "a"
+ And I have cursors at "text" in "This text contains the word text twice"
+ When I press "C-! y"
+ And I press "C-!"
+ Then I should see "This aatext contains the word aatext twice"
+
+ Scenario: Unknown command: no, don't do for all
+ Given I have bound C-! to another new command that inserts "a"
+ And I have cursors at "text" in "This text contains the word text twice"
+ When I press "C-! n"
+ And I press "C-!"
+ Then I should see "This aatext contains the word text twice"
+
Scenario: Setting and popping mark
Given I have cursors at "text" in "This text contains the word text twice"
And I press "C-SPC"
diff --git a/features/step-definitions/multiple-cursors-steps.el
b/features/step-definitions/multiple-cursors-steps.el
index 0ade5ec..e1734d7 100644
--- a/features/step-definitions/multiple-cursors-steps.el
+++ b/features/step-definitions/multiple-cursors-steps.el
@@ -52,3 +52,15 @@
(lambda (ins)
(lexical-let ((ins ins))
(global-set-key (kbd "C-!") #'(lambda () (interactive) (insert
ins))))))
+
+(Given "^I have bound C-! to a new command that inserts \"\\(.+\\)\"$"
+ (lambda (ins)
+ (lexical-let ((ins ins))
+ (defun mc-test-temp-command () (interactive) (insert ins))
+ (global-set-key (kbd "C-!") 'mc-test-temp-command))))
+
+(Given "^I have bound C-! to another new command that inserts \"\\(.+\\)\"$"
+ (lambda (ins)
+ (lexical-let ((ins ins))
+ (defun mc-test-temp-command-2 () (interactive) (insert ins))
+ (global-set-key (kbd "C-!") 'mc-test-temp-command-2))))