-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Feature: Drag Stuff | ||
In order to move stuff in Emacs | ||
As an Emacs user | ||
I want to drag them | ||
|
||
Background: | ||
Given I am in buffer "*drag-stuff*" | ||
And the buffer is empty | ||
And transient mark mode is active | ||
And there is no region selected | ||
|
||
Scenario: Global mode | ||
When I open temp file "global" | ||
And I insert: | ||
""" | ||
line 1 | ||
line 2 | ||
""" | ||
And I load the following: | ||
""" | ||
(drag-stuff-global-mode t) | ||
""" | ||
When I go to line "1" | ||
And I press "<M-down>" | ||
Then I should see: | ||
""" | ||
line 2 | ||
line 1 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Feature: Drag line | ||
In order to move a line up and down | ||
As an emacs user | ||
I want to drag it | ||
|
||
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 enable drag-stuff | ||
|
||
Scenario: Drag line up | ||
When I go to line "2" | ||
And I press "<M-up>" | ||
Then I should see: | ||
""" | ||
line 2 | ||
line 1 | ||
""" | ||
|
||
Scenario: Drag line down | ||
When I go to line "1" | ||
And I press "<M-down>" | ||
Then I should see: | ||
""" | ||
line 2 | ||
line 1 | ||
""" | ||
|
||
Scenario: Drag line down out of scope | ||
When I go to line "2" | ||
And I press "<M-down>" | ||
Then I should see: | ||
""" | ||
line 1 | ||
line 2 | ||
""" | ||
And I should see message "Can not move line further down" | ||
|
||
Scenario: Drag line up out of scope | ||
When I go to line "1" | ||
And I press "<M-up>" | ||
Then I should see: | ||
""" | ||
line 1 | ||
line 2 | ||
""" | ||
And I should see message "Can not move line further up" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
Feature: Drag lines | ||
In order to move lines up and down | ||
As an emacs user | ||
I want to drag them | ||
|
||
Background: | ||
And I am in buffer "*drag-stuff*" | ||
And the buffer is empty | ||
And I insert: | ||
""" | ||
line 1 | ||
line 2 | ||
line 3 | ||
""" | ||
And there is no region selected | ||
And I enable drag-stuff | ||
|
||
Scenario: Drag lines up | ||
When I go to point "10" | ||
And I set the mark | ||
And I go to point "17" | ||
When I press "<M-up>" | ||
Then I should see: | ||
""" | ||
line 2 | ||
line 3 | ||
line 1 | ||
""" | ||
And the region should be: | ||
""" | ||
ne 2 | ||
li | ||
""" | ||
|
||
Scenario: Drag lines down | ||
When I go to point "3" | ||
And I set the mark | ||
And I go to point "10" | ||
When I press "<M-down>" | ||
Then I should see: | ||
""" | ||
line 3 | ||
line 1 | ||
line 2 | ||
""" | ||
And the region should be: | ||
""" | ||
ne 1 | ||
li | ||
""" | ||
|
||
Scenario: Drag lines up out of scope | ||
When I go to point "3" | ||
And I set the mark | ||
And I go to point "10" | ||
When I press "<M-up>" | ||
Then I should see: | ||
""" | ||
line 1 | ||
line 2 | ||
line 3 | ||
""" | ||
And I should see message "Can not move lines further up" | ||
And the region should be: | ||
""" | ||
ne 1 | ||
li | ||
""" | ||
|
||
Scenario: Drag lines down out of scope | ||
When I go to point "10" | ||
And I set the mark | ||
And I go to point "17" | ||
When I press "<M-down>" | ||
Then I should see: | ||
""" | ||
line 1 | ||
line 2 | ||
line 3 | ||
""" | ||
And I should see message "Can not move lines further down" | ||
And the region should be: | ||
""" | ||
ne 2 | ||
li | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Feature: Drag region | ||
In order to move a region left and right | ||
As an emacs user | ||
I want to drag it | ||
|
||
Background: | ||
And I am in buffer "*drag-stuff*" | ||
And the buffer is empty | ||
And I insert "beforeREGIONafter" | ||
And there is no region selected | ||
And I enable drag-stuff | ||
|
||
Scenario: Drag region left | ||
When I select "REGION" | ||
And I press "<M-left>" | ||
Then I should see "beforREGIONeafter" | ||
And the region should be "REGION" | ||
|
||
Scenario: Drag region right | ||
When I select "REGION" | ||
And I press "<M-right>" | ||
Then I should see "beforeaREGIONfter" | ||
And the region should be "REGION" | ||
|
||
Scenario: Drag word left out of scope | ||
When I select "before" | ||
And I press "<M-left>" | ||
Then I should see "beforeREGIONafter" | ||
And I should see message "Can not move region further to the left" | ||
And the region should be "before" | ||
|
||
Scenario: Drag word right out of scope | ||
When I select "after" | ||
And I press "<M-right>" | ||
Then I should see "beforeREGIONafter" | ||
And I should see message "Can not move region further to the right" | ||
And the region should be "after" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(Given "^I \\(enable\\|disable\\) drag-stuff$" | ||
(lambda (status) | ||
(if (string= status "enable") | ||
(turn-on-drag-stuff-mode) | ||
(turn-off-drag-stuff-mode)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(add-to-list 'load-path "~/dev/drag-stuff") | ||
(require 'drag-stuff) | ||
|
||
(add-to-list 'load-path "~/dev/espuds") | ||
(require 'espuds) | ||
|
||
(Before | ||
(setq transient-mark-mode t)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Feature: Drag word | ||
In order to move a word left and right | ||
As an emacs user | ||
I want to drag it | ||
|
||
Background: | ||
And I am in buffer "*drag-stuff*" | ||
And the buffer is empty | ||
And I insert "word1 word2 word3" | ||
And there is no region selected | ||
And I enable drag-stuff | ||
|
||
Scenario: Drag word left | ||
When I go to word "word3" | ||
And I press "<M-left>" | ||
Then I should see "word1 word3 word2" | ||
|
||
Scenario: Drag word right | ||
When I go to word "word1" | ||
And I press "<M-right>" | ||
Then I should see "word2 word1 word3" | ||
|
||
Scenario: Drag word left out of scope | ||
When I go to word "word1" | ||
And I press "<M-left>" | ||
Then I should see "word1 word2 word3" | ||
And I should see message "Can not move word further to the left" | ||
|
||
Scenario: Drag word right out of scope | ||
When I go to word "word3" | ||
And I press "<M-right>" | ||
Then I should see "word1 word2 word3" | ||
And I should see message "Can not move word further to the right" |