Skip to content
Browse files

Added tests for modifier.

  • Loading branch information...
1 parent 1b46a6a commit de6ac6608f26231ea79bf278dbf00c48ce4c01b3 @rejeep rejeep committed
Showing with 70 additions and 1 deletion.
  1. +55 −0 features/modifier.feature
  2. +15 −1 features/support.el
View
55 features/modifier.feature
@@ -0,0 +1,55 @@
+Feature: Modifier
+ In order to change prefix key
+ As a drag stuff user
+ I want to change the modifier key
+
+ Background:
+ Given I am in buffer "*drag-stuff*"
+ And the buffer is empty
+ And I insert:
+ """
+ line 1
+ line 2
+ """
+ And there is no region selected
+ And I go to line "1"
+
+ Scenario: Change modifier key
+ When I load the following:
+ """
+ (setq drag-stuff-modifier 'control)
+ """
+ And I enable drag-stuff
+ And I press "<M-down>"
+ Then I should see:
+ """
+ line 1
+ line 2
+ """
+ And I should see message "<M-down> is undefined"
+
+ Scenario: Single modifier key
+ When I load the following:
+ """
+ (setq drag-stuff-modifier 'control)
+ """
+ And I enable drag-stuff
+ When I press "<C-down>"
+ Then I should see:
+ """
+ line 2
+ line 1
+ """
+
+ Scenario: Multiple modifier keys
+ When I load the following:
+ """
+ (setq drag-stuff-modifier '(meta shift))
+ """
+ And I enable drag-stuff
+ When I press "<M-S-down>"
+ Then I should see:
+ """
+ line 2
+ line 1
+ """
View
16 features/support.el
@@ -10,4 +10,18 @@
(require 'espuds)
(Before
- (setq transient-mark-mode t))
+ ;; Always have transient mark mode active
+ (setq transient-mark-mode t)
+
+ ;; Do not use the global mode
+ (drag-stuff-global-mode -1)
+ )
+
+(After
+ ;; Reset the modifier
+ (setq drag-stuff-modifier 'meta)
+
+ ;; Remove all bindings
+ (dolist (direction '(up down left right))
+ (define-key drag-stuff-mode-map (drag-stuff--kbd direction) nil))
+ )

0 comments on commit de6ac66

Please sign in to comment.
Something went wrong with that request. Please try again.