aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2012-09-19 02:10:19 +0400
committerDmitry Gutov2012-09-19 02:10:19 +0400
commit32fb816220e7a9f5450f276b94e3300c0b3baf4e (patch)
tree28475cd3a5860e6df8595dc5b82b25be1f81ed11 /test
parent5fb91e7197bd800240e39a05c070ca37860af68a (diff)
downloademacs-32fb816220e7a9f5450f276b94e3300c0b3baf4e.tar.gz
emacs-32fb816220e7a9f5450f276b94e3300c0b3baf4e.zip
* lisp/progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extra
whitespace after "end". (ruby-do-end-to-brace): Collapse block to one line if it fits within fill-column.
Diffstat (limited to 'test')
-rw-r--r--test/automated/ruby-mode-tests.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index e711b52fb9c..ba3040577b1 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -219,12 +219,16 @@ VALUES-PLIST is a list with alternating index and value elements."
219 (should (string= "foo do |b|\nend" (buffer-string))))) 219 (should (string= "foo do |b|\nend" (buffer-string)))))
220 220
221(ert-deftest ruby-toggle-block-to-brace () 221(ert-deftest ruby-toggle-block-to-brace ()
222 (with-temp-buffer 222 (let ((pairs '((16 . "foo {|b| b + 2 }")
223 (insert "foo do |b|\nend") 223 (15 . "foo {|b|\n b + 2\n}"))))
224 (ruby-mode) 224 (dolist (pair pairs)
225 (beginning-of-line) 225 (with-temp-buffer
226 (ruby-toggle-block) 226 (let ((fill-column (car pair)))
227 (should (string= "foo {|b|\n}" (buffer-string))))) 227 (insert "foo do |b|\n b + 2\nend")
228 (ruby-mode)
229 (beginning-of-line)
230 (ruby-toggle-block)
231 (should (string= (cdr pair) (buffer-string))))))))
228 232
229(ert-deftest ruby-toggle-block-to-multiline () 233(ert-deftest ruby-toggle-block-to-multiline ()
230 (with-temp-buffer 234 (with-temp-buffer