1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 03:40:56 -08:00

* lisp/progmodes/ruby-mode.el (ruby-expr-beg): Make heredoc detection

more strict.  Add docstring.

* test/automated/ruby-mode-tests.el (ruby-indent-singleton-class): Pass.
(ruby-indent-inside-heredoc-after-operator)
(ruby-indent-inside-heredoc-after-space): New tests.
This commit is contained in:
Dmitry Gutov 2012-11-14 10:34:17 +04:00
parent f360feb8ec
commit 8619323f69
4 changed files with 32 additions and 6 deletions

View file

@ -154,7 +154,6 @@ VALUES-PLIST is a list with alternating index and value elements."
|"))
(ert-deftest ruby-indent-singleton-class ()
:expected-result :failed ; Doesn't work yet, when no space before "<<".
(ruby-should-indent-buffer
"class<<bar
| foo
@ -165,6 +164,20 @@ VALUES-PLIST is a list with alternating index and value elements."
| end
|"))
(ert-deftest ruby-indent-inside-heredoc-after-operator ()
(ruby-should-indent-buffer
"b=<<eos
| 42"
"b=<<eos
| 42"))
(ert-deftest ruby-indent-inside-heredoc-after-space ()
(ruby-should-indent-buffer
"foo <<eos.gsub(' ', '*')
| 42"
"foo <<eos.gsub(' ', '*')
| 42"))
(ert-deftest ruby-indent-array-literal ()
(let ((ruby-deep-indent-paren nil))
(ruby-should-indent-buffer