| 1 | ;;; ruby-mode-tests.el --- Test suite for ruby-mode |
| 2 | |
| 3 | ;; Copyright (C) 2012 Free Software Foundation, Inc. |
| 4 | |
| 5 | ;; This file is part of GNU Emacs. |
| 6 | |
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
| 8 | ;; it under the terms of the GNU General Public License as published by |
| 9 | ;; the Free Software Foundation, either version 3 of the License, or |
| 10 | ;; (at your option) any later version. |
| 11 | |
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | ;; GNU General Public License for more details. |
| 16 | |
| 17 | ;; You should have received a copy of the GNU General Public License |
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | ;;; Commentary: |
| 21 | |
| 22 | ;;; Code: |
| 23 | |
| 24 | (require 'ruby-mode) |
| 25 | |
| 26 | (ert-deftest indent-line-after-symbol-made-from-string-interpolation () |
| 27 | "It can indent the line after symbol made using string interpolation." |
| 28 | (let ((initial-content "def foo(suffix)\n :\"bar#{suffix}\"\n") |
| 29 | (expected-content "def foo(suffix)\n :\"bar#{suffix}\"\n ")) |
| 30 | (with-temp-buffer |
| 31 | (insert initial-content) |
| 32 | (ruby-indent-line) ; Doesn't rely on text properties or the syntax table. |
| 33 | (let ((buffer-content (buffer-substring-no-properties (point-min) |
| 34 | (point-max)))) |
| 35 | (should (string= buffer-content expected-content)))))) |
| 36 | |
| 37 | (provide 'ruby-mode-tests) |
| 38 | |
| 39 | ;;; ruby-mode-tests.el ends here |