(ert-deftest ruby-slash-char-literal-is-not-mistaken-for-regexp ()
(ruby-assert-state "?/" 3 nil))
+(ert-deftest ruby-regexp-is-not-mistaken-for-slash-symbol ()
+ (ruby-assert-state "x = /foo:/" 3 nil))
+
(ert-deftest ruby-indent-simple ()
(ruby-should-indent-buffer
"if foo
(ruby-backward-sexp)
(should (= 2 (line-number-at-pos)))))
+(ert-deftest ruby-toggle-string-quotes-quotes-correctly ()
+ (let ((pairs
+ '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"")
+ ("puts \"'foo'\\\"\"" . "puts '\\'foo\\'\"'"))))
+ (dolist (pair pairs)
+ (ruby-with-temp-buffer (car pair)
+ (beginning-of-line)
+ (search-forward "foo")
+ (ruby-toggle-string-quotes)
+ (should (string= (buffer-string) (cdr pair)))))))
+
(ert-deftest ruby--insert-coding-comment-ruby-style ()
(with-temp-buffer
(let ((ruby-encoding-magic-comment-style 'ruby))