(ruby-with-temp-buffer ruby-sexp-test-example
(goto-char (point-min))
(forward-line 1)
- (ruby-forward-sexp)
+ (forward-sexp)
(should (= 8 (line-number-at-pos)))))
(ert-deftest ruby-backward-sexp-skips-method-calls-with-keyword-names ()
(goto-char (point-min))
(forward-line 7)
(end-of-line)
- (ruby-backward-sexp)
+ (backward-sexp)
(should (= 2 (line-number-at-pos)))))
(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-no-args ()
"proc do
|end")
(search-backward "do\n")
- (ruby-forward-sexp)
+ (forward-sexp)
(should (eobp))))
(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-no-args ()
"proc do
|end")
(goto-char (point-max))
- (ruby-backward-sexp)
+ (backward-sexp)
(should (looking-at "do$"))))
(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-empty-args ()
"proc do ||
|end")
(search-backward "do ")
- (ruby-forward-sexp)
+ (forward-sexp)
(should (eobp))))
(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-empty-args ()
"proc do ||
|end")
(goto-char (point-max))
- (ruby-backward-sexp)
+ (backward-sexp)
(should (looking-at "do "))))
(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-args ()
"proc do |a,b|
|end")
(search-backward "do ")
- (ruby-forward-sexp)
+ (forward-sexp)
(should (eobp))))
(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-args ()
"proc do |a,b|
|end")
(goto-char (point-max))
- (ruby-backward-sexp)
+ (backward-sexp)
(should (looking-at "do "))))
(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-any-args ()
"proc do |*|
|end")
(search-backward "do ")
- (ruby-forward-sexp)
+ (forward-sexp)
(should (eobp))))
(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg ()
"proc do |a,|
|end")
(search-backward "do ")
- (ruby-forward-sexp)
+ (forward-sexp)
(should (eobp))))
(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args ()
"proc do |a,*|
|end")
(search-backward "do ")
- (ruby-forward-sexp)
+ (forward-sexp)
(should (eobp))))
(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args ()
"proc do |a,*|
|end")
(goto-char (point-max))
- (ruby-backward-sexp)
+ (backward-sexp)
(should (looking-at "do "))))
(ert-deftest ruby-toggle-string-quotes-quotes-correctly ()