diff options
| author | Nobuyoshi Nakada | 2012-08-12 18:06:56 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-08-12 18:06:56 -0400 |
| commit | 0d9e2599ec037fe0582c36ea5e965cd6fa65d9dc (patch) | |
| tree | 72bedb63adb998b382171b37bc3ae5c0aa8122dc /test | |
| parent | 577d5eea9a7b6f0cfdf7fafb6d2fdc82e4d702a7 (diff) | |
| download | emacs-0d9e2599ec037fe0582c36ea5e965cd6fa65d9dc.tar.gz emacs-0d9e2599ec037fe0582c36ea5e965cd6fa65d9dc.zip | |
Merge from upstream ruby-mode.el
* lisp/progmodes/ruby-mode.el (ruby-mode-map): Remove unnecessary
binding for `newline'.
(ruby-move-to-block): When moving backward, stop at block opening,
not indentation.
* progmodes/ruby-mode.el (ruby-brace-to-do-end)
(ruby-do-end-to-brace, ruby-toggle-block): New functions.
* progmodes/ruby-mode.el (ruby-mode-map): Add binding for
`ruby-toggle-block'.
* test/automated/ruby-mode-tests.el (ruby-move-to-block-stops-at-opening)
(ruby-toggle-block-to-do-end, ruby-toggle-block-to-brace): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 9 | ||||
| -rw-r--r-- | test/automated/ruby-mode-tests.el | 26 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 0e016260abe..a0163b56e6d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-08-12 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * automated/ruby-mode-tests.el (ruby-move-to-block-stops-at-opening) | ||
| 4 | (ruby-toggle-block-to-do-end, ruby-toggle-block-to-brace): New test. | ||
| 5 | |||
| 1 | 2012-08-11 Glenn Morris <rgm@gnu.org> | 6 | 2012-08-11 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * automated/files.el: New file. | 8 | * automated/files.el: New file. |
| @@ -12,6 +17,10 @@ | |||
| 12 | Add tests for `ruby-deep-indent-paren' behavior. | 17 | Add tests for `ruby-deep-indent-paren' behavior. |
| 13 | Port all tests from test/misc/test_ruby_mode.rb in Ruby repo. | 18 | Port all tests from test/misc/test_ruby_mode.rb in Ruby repo. |
| 14 | 19 | ||
| 20 | 2012-08-10 Nobuyoshi Nakada <nobu@ruby-lang.org> | ||
| 21 | |||
| 22 | Original tests in test_ruby_mode.rb in upstream (author). | ||
| 23 | |||
| 15 | 2012-08-09 Dmitry Gutov <dgutov@yandex.ru> | 24 | 2012-08-09 Dmitry Gutov <dgutov@yandex.ru> |
| 16 | 25 | ||
| 17 | * automated/ruby-mode-tests.el (ruby-should-indent) | 26 | * automated/ruby-mode-tests.el (ruby-should-indent) |
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el index f91b6e44b22..df51aa0d15a 100644 --- a/test/automated/ruby-mode-tests.el +++ b/test/automated/ruby-mode-tests.el | |||
| @@ -191,6 +191,32 @@ VALUES-PLIST is a list with alternating index and value elements." | |||
| 191 | | end | 191 | | end |
| 192 | |")) | 192 | |")) |
| 193 | 193 | ||
| 194 | (ert-deftest ruby-move-to-block-stops-at-opening () | ||
| 195 | (with-temp-buffer | ||
| 196 | (insert "def f\nend") | ||
| 197 | (beginning-of-line) | ||
| 198 | (ruby-mode) | ||
| 199 | (ruby-move-to-block -1) | ||
| 200 | (should (looking-at "f$")))) | ||
| 201 | |||
| 202 | (ert-deftest ruby-toggle-block-to-do-end () | ||
| 203 | (with-temp-buffer | ||
| 204 | (insert "foo {|b|\n}\n") | ||
| 205 | (ruby-mode) | ||
| 206 | (search-backward "{") | ||
| 207 | (ruby-toggle-block) | ||
| 208 | (should (string= "foo do |b|\nend\n" (buffer-substring-no-properties | ||
| 209 | (point-min) (point-max)))))) | ||
| 210 | |||
| 211 | (ert-deftest ruby-toggle-block-to-brace () | ||
| 212 | (with-temp-buffer | ||
| 213 | (insert "foo do |b|\nend\n") | ||
| 214 | (ruby-mode) | ||
| 215 | (search-backward "do") | ||
| 216 | (ruby-toggle-block) | ||
| 217 | (should (string= "foo {|b|\n}\n" (buffer-substring-no-properties | ||
| 218 | (point-min) (point-max)))))) | ||
| 219 | |||
| 194 | (provide 'ruby-mode-tests) | 220 | (provide 'ruby-mode-tests) |
| 195 | 221 | ||
| 196 | ;;; ruby-mode-tests.el ends here | 222 | ;;; ruby-mode-tests.el ends here |