diff options
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 |