summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2012-09-19 02:10:19 +0400
committerDmitry Gutov <dgutov@yandex.ru>2012-09-19 02:10:19 +0400
commit32fb816220e7a9f5450f276b94e3300c0b3baf4e (patch)
tree28475cd3a5860e6df8595dc5b82b25be1f81ed11 /test
parent5fb91e7197bd800240e39a05c070ca37860af68a (diff)
downloademacs-32fb816220e7a9f5450f276b94e3300c0b3baf4e.tar.gz
* 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."
(should (string= "foo do |b|\nend" (buffer-string)))))
(ert-deftest ruby-toggle-block-to-brace ()
- (with-temp-buffer
- (insert "foo do |b|\nend")
- (ruby-mode)
- (beginning-of-line)
- (ruby-toggle-block)
- (should (string= "foo {|b|\n}" (buffer-string)))))
+ (let ((pairs '((16 . "foo {|b| b + 2 }")
+ (15 . "foo {|b|\n b + 2\n}"))))
+ (dolist (pair pairs)
+ (with-temp-buffer
+ (let ((fill-column (car pair)))
+ (insert "foo do |b|\n b + 2\nend")
+ (ruby-mode)
+ (beginning-of-line)
+ (ruby-toggle-block)
+ (should (string= (cdr pair) (buffer-string))))))))
(ert-deftest ruby-toggle-block-to-multiline ()
(with-temp-buffer