-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from joranvar/introduce-ecukes-for-testing
Introduce ecukes for testing
- Loading branch information
Showing
7 changed files
with
103 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 @@ | ||
.cask/ |
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,10 @@ | ||
(source gnu) | ||
(source melpa) | ||
|
||
(package-file "./yafolding.el") | ||
|
||
(development | ||
(depends-on "f") | ||
(depends-on "ecukes") | ||
(depends-on "ert-runner") | ||
(depends-on "el-mock")) |
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
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,35 @@ | ||
;; This file contains your project specific step definitions. All | ||
;; files in this directory whose names end with "-steps.el" will be | ||
;; loaded automatically by Ecukes. | ||
|
||
(Given "^I have an empty buffer$" | ||
(lambda () (erase-buffer))) | ||
|
||
(When "^I call yafolding-hide-all$" | ||
(lambda () (yafolding-hide-all))) | ||
|
||
(Then "^I should have an empty buffer$" | ||
(lambda () (should (= (point-min) (point-max) 1)))) | ||
|
||
(Given "^I have a buffer with \"\\([^\"]+\\)\"$" | ||
(lambda (filename) | ||
(erase-buffer) | ||
(insert-file-contents filename))) | ||
|
||
(And "^I am on line 2$" | ||
(lambda () (goto-line 2))) | ||
|
||
(And "^I go to line 1$" | ||
(lambda () (goto-line 1))) | ||
|
||
(And "^I call yafolding-hide-element$" | ||
(lambda () (yafolding-hide-element))) | ||
|
||
(Then "^I should see only one line$" | ||
(lambda () | ||
(save-excursion | ||
(next-line) | ||
(should (= (line-number-at-pos (point)) | ||
(line-number-at-pos (point-max))))))) | ||
|
||
;; End of steps file |
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,32 @@ | ||
(require 'f) | ||
|
||
(defvar yafolding-support-path | ||
(f-dirname load-file-name)) | ||
|
||
(defvar yafolding-features-path | ||
(f-parent yafolding-support-path)) | ||
|
||
(defvar yafolding-root-path | ||
(f-parent yafolding-features-path)) | ||
|
||
(add-to-list 'load-path yafolding-root-path) | ||
|
||
(require 'yafolding) | ||
(require 'espuds) | ||
(require 'ert) | ||
|
||
(Setup | ||
;; Before anything has run | ||
) | ||
|
||
(Before | ||
;; Before each scenario is run | ||
) | ||
|
||
(After | ||
;; After each scenario is run | ||
) | ||
|
||
(Teardown | ||
;; After when everything has been run | ||
) |
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,17 @@ | ||
Feature: Fold all lines | ||
In order to be able to visualize the outline of my file | ||
As a user | ||
I want to be able to fold all elements at once | ||
|
||
Scenario: Empty buffers are not changed | ||
Given I have an empty buffer | ||
When I call yafolding-hide-all | ||
Then I should have an empty buffer | ||
|
||
Scenario: Test file from issue #23 should collapse correctly | ||
Given I have a buffer with "test/data/issue-23.txt" | ||
And I am on line 2 | ||
When I call yafolding-hide-all | ||
And I go to line 1 | ||
And I call yafolding-hide-element | ||
Then I should see only one line |
File renamed without changes.