summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-10-10 17:43:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-10-10 17:43:47 -0400
commit6d8ca1720a1795d15493f03005390d8ffc559f30 (patch)
tree4cb8bf70bb6c2c3a203c0c19ebbc05203e7e1bee
parentee041f2d07b6ed485dc34c115588f973f046c9d4 (diff)
downloademacs-6d8ca1720a1795d15493f03005390d8ffc559f30.tar.gz
* test/automated/ruby-mode-tests.el (ruby-with-temp-buffer): Move before
first use. (ruby-should-indent): Use indent-according-to-mode. (ruby-deftest-move-to-block): Use `declare'.
-rw-r--r--test/ChangeLog7
-rw-r--r--test/automated/ruby-mode-tests.el19
2 files changed, 16 insertions, 10 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 2585561b840..ce3cdd2f1e3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2013-10-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * automated/ruby-mode-tests.el (ruby-with-temp-buffer): Move before
+ first use.
+ (ruby-should-indent): Use indent-according-to-mode.
+ (ruby-deftest-move-to-block): Use `declare'.
+
2013-10-07 Dmitry Gutov <dgutov@yandex.ru>
* indent/ruby.rb: Fix a spurious change, add more failing examples.
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index 86b123f9b14..dafe393377b 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -24,10 +24,17 @@
(require 'ert)
(require 'ruby-mode)
+(defmacro ruby-with-temp-buffer (contents &rest body)
+ (declare (indent 1) (debug t))
+ `(with-temp-buffer
+ (insert ,contents)
+ (ruby-mode)
+ ,@body))
+
(defun ruby-should-indent (content column)
"Assert indentation COLUMN on the last line of CONTENT."
(ruby-with-temp-buffer content
- (ruby-indent-line)
+ (indent-according-to-mode)
(should (= (current-indentation) column))))
(defun ruby-should-indent-buffer (expected content)
@@ -38,13 +45,6 @@ The whitespace before and including \"|\" on each line is removed."
(indent-region (point-min) (point-max))
(should (string= (ruby-test-string expected) (buffer-string)))))
-(defmacro ruby-with-temp-buffer (contents &rest body)
- (declare (indent 1) (debug t))
- `(with-temp-buffer
- (insert ,contents)
- (ruby-mode)
- ,@body))
-
(defun ruby-test-string (s &rest args)
(apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args))
@@ -471,6 +471,7 @@ VALUES-PLIST is a list with alternating index and value elements."
|end"))
(defmacro ruby-deftest-move-to-block (name &rest body)
+ (declare (indent defun))
`(ert-deftest ,(intern (format "ruby-move-to-block-%s" name)) ()
(with-temp-buffer
(insert ruby-block-test-example)
@@ -478,8 +479,6 @@ VALUES-PLIST is a list with alternating index and value elements."
(goto-char (point-min))
,@body)))
-(put 'ruby-deftest-move-to-block 'lisp-indent-function 'defun)
-
(ruby-deftest-move-to-block works-on-do
(forward-line 10)
(ruby-end-of-block)