[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115160: * test/automated/ruby-mode-tests.el:
From: |
Bozhidar Batsov |
Subject: |
[Emacs-diffs] trunk r115160: * test/automated/ruby-mode-tests.el: |
Date: |
Wed, 20 Nov 2013 11:55:31 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115160
revision-id: address@hidden
parent: address@hidden
committer: Bozhidar Batsov <address@hidden>
branch nick: master
timestamp: Wed 2013-11-20 13:51:12 +0200
message:
* test/automated/ruby-mode-tests.el:
Add a few tests for `ruby--insert-coding-comment'.
modified:
test/automated/ruby-mode-tests.el
rubymodetests.el-20120720101201-mn39s4kfopdxj3ek-1
=== modified file 'test/automated/ruby-mode-tests.el'
--- a/test/automated/ruby-mode-tests.el 2013-11-20 11:01:31 +0000
+++ b/test/automated/ruby-mode-tests.el 2013-11-20 11:51:12 +0000
@@ -619,6 +619,26 @@
(ruby-backward-sexp)
(should (= 2 (line-number-at-pos)))))
+(ert-deftest ruby--insert-coding-comment-ruby-style ()
+ (with-temp-buffer
+ (let ((ruby-encoding-magic-comment-style 'ruby))
+ (ruby--insert-coding-comment "utf-8")
+ (should (string= "# coding: utf-8\n" (buffer-string))))))
+
+(ert-deftest ruby--insert-coding-comment-emacs-style ()
+ (with-temp-buffer
+ (let ((ruby-encoding-magic-comment-style 'emacs))
+ (ruby--insert-coding-comment "utf-8")
+ (should (string= "# -*- coding: utf-8 -*-\n" (buffer-string))))))
+
+(ert-deftest ruby--insert-coding-comment-custom-style ()
+ (with-temp-buffer
+ (let ((ruby-encoding-magic-comment-style 'custom)
+ (ruby-custom-encoding-magic-comment-template "# encoding: %s\n"))
+ (ruby--insert-coding-comment "utf-8")
+ (should (string= "# encoding: utf-8\n\n" (buffer-string))))))
+
+
(provide 'ruby-mode-tests)
;;; ruby-mode-tests.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115160: * test/automated/ruby-mode-tests.el:,
Bozhidar Batsov <=