diff options
Diffstat (limited to 'test/lisp/progmodes/ruby-mode-tests.el')
-rw-r--r-- | test/lisp/progmodes/ruby-mode-tests.el | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 6bdc7651ff1..97ac1e1ecd9 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -1,4 +1,4 @@ -;;; ruby-mode-tests.el --- Test suite for ruby-mode +;;; ruby-mode-tests.el --- Test suite for ruby-mode -*- lexical-binding:t -*- ;; Copyright (C) 2012-2020 Free Software Foundation, Inc. @@ -22,6 +22,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'ruby-mode) (defmacro ruby-with-temp-buffer (contents &rest body) @@ -711,7 +712,7 @@ VALUES-PLIST is a list with alternating index and value elements." (ruby-with-temp-buffer ruby-sexp-test-example (goto-char (point-min)) (forward-line 1) - (ruby-forward-sexp) + (forward-sexp) (should (= 8 (line-number-at-pos))))) (ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names () @@ -719,7 +720,7 @@ VALUES-PLIST is a list with alternating index and value elements." (goto-char (point-min)) (forward-line 7) (end-of-line) - (ruby-backward-sexp) + (backward-sexp) (should (= 2 (line-number-at-pos))))) (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-no-args () @@ -728,7 +729,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |end") (search-backward "do\n") - (ruby-forward-sexp) + (forward-sexp) (should (eobp)))) (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-no-args () @@ -737,7 +738,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |end") (goto-char (point-max)) - (ruby-backward-sexp) + (backward-sexp) (should (looking-at "do$")))) (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-empty-args () @@ -746,7 +747,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do || |end") (search-backward "do ") - (ruby-forward-sexp) + (forward-sexp) (should (eobp)))) (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-empty-args () @@ -755,7 +756,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do || |end") (goto-char (point-max)) - (ruby-backward-sexp) + (backward-sexp) (should (looking-at "do ")))) (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-args () @@ -764,7 +765,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |a,b| |end") (search-backward "do ") - (ruby-forward-sexp) + (forward-sexp) (should (eobp)))) (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-args () @@ -773,7 +774,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |a,b| |end") (goto-char (point-max)) - (ruby-backward-sexp) + (backward-sexp) (should (looking-at "do ")))) (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-any-args () @@ -782,7 +783,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |*| |end") (search-backward "do ") - (ruby-forward-sexp) + (forward-sexp) (should (eobp)))) (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg () @@ -791,7 +792,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |a,| |end") (search-backward "do ") - (ruby-forward-sexp) + (forward-sexp) (should (eobp)))) (ert-deftest ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args () @@ -800,7 +801,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |a,*| |end") (search-backward "do ") - (ruby-forward-sexp) + (forward-sexp) (should (eobp)))) (ert-deftest ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args () @@ -809,7 +810,7 @@ VALUES-PLIST is a list with alternating index and value elements." "proc do |a,*| |end") (goto-char (point-max)) - (ruby-backward-sexp) + (backward-sexp) (should (looking-at "do ")))) (ert-deftest ruby-toggle-string-quotes-quotes-correctly () @@ -842,6 +843,16 @@ VALUES-PLIST is a list with alternating index and value elements." (ruby--insert-coding-comment "utf-8") (should (string= "# encoding: utf-8\n\n" (buffer-string)))))) +(ert-deftest ruby--indent/converted-from-manual-test () + :tags '(:expensive-test) + ;; Converted from manual test. + (let ((buf (find-file-noselect (ert-resource-file "ruby.rb")))) + (unwind-protect + (with-current-buffer buf + (let ((orig (buffer-string))) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig)))) + (kill-buffer buf)))) (provide 'ruby-mode-tests) |