diff options
| author | Dmitry Gutov | 2013-04-16 03:07:14 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-04-16 03:07:14 +0400 |
| commit | fb549d640a32fb02bb8329727891de395e691c45 (patch) | |
| tree | 5078c224de071e5df52bd773f7a538d919b19b1d /test | |
| parent | 21e8fe2f857c0d7bb50809bc34d22586dc7da893 (diff) | |
| download | emacs-fb549d640a32fb02bb8329727891de395e691c45.tar.gz emacs-fb549d640a32fb02bb8329727891de395e691c45.zip | |
* lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun)
(ruby-end-of-defun, ruby-move-to-block): Bind `case-fold-search'
to nil.
(ruby-end-of-defun): Remove the unused arg, change the docstring
to reflect that this function is only used as the value of
`end-of-defun-function'.
(ruby-beginning-of-defun): Remove "top-level" from the docstring,
to reflect an earlier change that beginning/end-of-defun functions
jump between methods in a class definition, as well as top-level
functions.
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/ruby-mode-tests.el | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index 0ebe6d44e34..23dc45ad509 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el | |||
| @@ -487,6 +487,42 @@ VALUES-PLIST is a list with alternating index and value elements." | |||
| 487 | (ruby-beginning-of-block) | 487 | (ruby-beginning-of-block) |
| 488 | (should (= 1 (line-number-at-pos))))) | 488 | (should (= 1 (line-number-at-pos))))) |
| 489 | 489 | ||
| 490 | (ert-deftest ruby-move-to-block-does-not-fold-case () | ||
| 491 | (ruby-with-temp-buffer | ||
| 492 | (ruby-test-string | ||
| 493 | "foo do | ||
| 494 | | Module.to_s | ||
| 495 | |end") | ||
| 496 | (end-of-buffer) | ||
| 497 | (let ((case-fold-search t)) | ||
| 498 | (ruby-beginning-of-block)) | ||
| 499 | (should (= 1 (line-number-at-pos))))) | ||
| 500 | |||
| 501 | (ert-deftest ruby-beginning-of-defun-does-not-fold-case () | ||
| 502 | (ruby-with-temp-buffer | ||
| 503 | (ruby-test-string | ||
| 504 | "class C | ||
| 505 | | def bar | ||
| 506 | | Class.to_s | ||
| 507 | | end | ||
| 508 | |end") | ||
| 509 | (goto-line 4) | ||
| 510 | (let ((case-fold-search t)) | ||
| 511 | (beginning-of-defun)) | ||
| 512 | (should (= 2 (line-number-at-pos))))) | ||
| 513 | |||
| 514 | (ert-deftest ruby-end-of-defun-skips-to-next-line-after-the-method () | ||
| 515 | (ruby-with-temp-buffer | ||
| 516 | (ruby-test-string | ||
| 517 | "class D | ||
| 518 | | def tee | ||
| 519 | | 'ho hum' | ||
| 520 | | end | ||
| 521 | |end") | ||
| 522 | (goto-line 2) | ||
| 523 | (end-of-defun) | ||
| 524 | (should (= 5 (line-number-at-pos))))) | ||
| 525 | |||
| 490 | (provide 'ruby-mode-tests) | 526 | (provide 'ruby-mode-tests) |
| 491 | 527 | ||
| 492 | ;;; ruby-mode-tests.el ends here | 528 | ;;; ruby-mode-tests.el ends here |