Skip to content

Commit

Permalink
Add ecukes test for issue 23
Browse files Browse the repository at this point in the history
  • Loading branch information
joranvar committed Aug 16, 2016
1 parent 0609f3c commit df751d7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions features/step-definitions/yafolding-steps.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,26 @@

(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
8 changes: 8 additions & 0 deletions features/yafolding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ Feature: Fold all lines
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

0 comments on commit df751d7

Please sign in to comment.