]> code.delx.au - gnu-emacs/blobdiff - test/automated/ruby-mode-tests.el
Implement user option ruby-align-chained-calls
[gnu-emacs] / test / automated / ruby-mode-tests.el
index de0c1bb9629678eb437c4d8a2752fa880a629d3a..f6fddb5ef4cfd036548bb50c038a0cb7dc95d023 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ruby-mode-tests.el --- Test suite for ruby-mode
 
-;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -333,6 +333,20 @@ VALUES-PLIST is a list with alternating index and value elements."
      |      42
      |    end")))
 
+(ert-deftest ruby-align-chained-calls ()
+  (let ((ruby-align-chained-calls t))
+    (ruby-should-indent-buffer
+     "one.two.three
+     |       .four
+     |
+     |my_array.select { |str| str.size > 5 }
+     |        .map    { |str| str.downcase }"
+     "one.two.three
+     |  .four
+     |
+     |my_array.select { |str| str.size > 5 }
+     |   .map    { |str| str.downcase }")))
+
 (ert-deftest ruby-move-to-block-stops-at-indentation ()
   (ruby-with-temp-buffer "def f\nend"
     (beginning-of-line)