Refactor mark-dwim tests to share a common background

This commit is contained in:
Maciej Katafiasz 2013-09-05 18:42:16 +02:00
parent 45ed43e1f8
commit bf4b0c669b

View File

@ -1,13 +1,16 @@
Feature: Mark all do-what-I-mean
Scenario: Mark symbols in defun
Background:
Given I turn on emacs-lisp-mode
And I turn on delete-selection-mode
And I insert:
"""
(defun abc (ghi) (message ghi))
(defun def (ghi) (message some-other-ghi))
"""
Scenario: Mark symbols in defun
When I go to the end of the word "abc"
And I press "M-f"
And I press "M-$"
@ -27,15 +30,7 @@ Feature: Mark all do-what-I-mean
(defun def (ghi) (message some-other-ghi))
"""
Scenario: Mark all symbols by pressing twice
Given I turn on emacs-lisp-mode
And I turn on delete-selection-mode
And I insert:
"""
(defun abc (ghi) (message ghi))
(defun def (ghi) (message ghi))
"""
When I go to the end of the word "abc"
And I press "M-f"
And I press "M-$"
@ -44,10 +39,10 @@ Feature: Mark all do-what-I-mean
Then I should see:
"""
(defun abc (hmm) (message hmm))
(defun def (hmm) (message hmm))
(defun def (hmm) (message some-other-hmm))
"""
When I press "C-g"
And I press "M-> RET"
And I press "M->"
And I insert:
"""
(defun def (hmm-hmm) (message hmm))
@ -59,19 +54,11 @@ Feature: Mark all do-what-I-mean
Then I should see:
"""
(defun abc (humm) (message humm))
(defun def (humm) (message humm))
(defun def (humm) (message some-other-humm))
(defun def (humm-humm) (message humm))
"""
Scenario: Mark dwim from selection
Given I turn on emacs-lisp-mode
And I turn on delete-selection-mode
And I insert:
"""
(defun abc (ghi) (message ghi))
(defun def (ghi) (message some-other-ghi))
"""
When I press "M-<"
And I press "S-M->"
And I press "C-$ ghi RET"
@ -80,7 +67,6 @@ Feature: Mark all do-what-I-mean
"""
(defun abc (xyz) (message xyz))
(defun def (xyz) (message some-other-xyz))
"""
When I press "C-g"
And I go to the front of the word "xyz"
@ -91,7 +77,6 @@ Feature: Mark all do-what-I-mean
"""
(defun abc (foo) (message foo))
(defun def (xyz) (message some-other-xyz))
"""
When I press "C-g"
And I press "M-<"
@ -102,5 +87,4 @@ Feature: Mark all do-what-I-mean
"""
;;(defun abc (foo) (message foo))
;;(defun def (xyz) (message some-other-xyz))
"""