nlamirault / scame

An Emacs configuration
Other
5 stars 0 forks source link

Unit tests for perspective mode doesn't works #25

Closed nlamirault closed 10 years ago

nlamirault commented 10 years ago

Current unit test :

(ert-deftest test-perspective ()
  (with-current-file "var/hello.php"
    (should (require 'perspective))
    (should (eql 'persp-switch (key-binding (kbd "C-x x s"))))
    (should (eql 'persp-remove-buffer (key-binding (kbd "C-x x k"))))
    (should (eql 'persp-kill (key-binding (kbd "C-x x c"))))
    (should (eql 'persp-rename (key-binding (kbd "C-x x r"))))
    (should (eql 'persp-add-buffer (key-binding (kbd "C-x x a"))))
    (should (eql 'persp-import (key-binding (kbd "C-x x i"))))
    (should (eql 'persp-next (key-binding (kbd "C-x x n"))))
    (should (eql 'persp-prev (key-binding (kbd "C-x x p"))))))

Result :

Test test-perspective condition:
    (ert-test-failed
     ((should
       (eql 'persp-switch
         (key-binding ...)))
      :form
      (eql persp-switch nil)
      :value nil))

But it works fine in Emacs instance.

nlamirault commented 10 years ago
(ert-deftest test-perspective ()
  (with-current-file "var/hello.php"
      (persp-mode)
      (should (require 'persp-projectile))
      (should (eql 'projectile-find-file  (key-binding (kbd "C-c p f"))))
      (should (eql 'persp-switch (key-binding (kbd "C-x x s"))))
      (should (eql 'persp-remove-buffer (key-binding (kbd "C-x x k"))))
      (should (eql 'persp-kill (key-binding (kbd "C-x x c"))))
      (should (eql 'persp-rename (key-binding (kbd "C-x x r"))))
      (should (eql 'persp-add-buffer (key-binding (kbd "C-x x a"))))
      (should (eql 'persp-import (key-binding (kbd "C-x x i"))))
      (should (eql 'persp-next (key-binding (kbd "C-x x n"))))
      (should (eql 'persp-prev (key-binding (kbd "C-x x p"))))))