Navigation Menu

Skip to content

Commit

Permalink
delete old fakir-mock-process test and reorganize fakir-mock-process-…
Browse files Browse the repository at this point in the history
…delete test
  • Loading branch information
nicferrier committed Jan 9, 2014
1 parent 374120e commit d9de8e0
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions fakir-tests.el
Expand Up @@ -42,39 +42,6 @@
(should (equal nil (gethash ':self-evaling-symbol-as-well h)))))


(ert-deftest fakir-mock-process ()
"Basic test of the mock process."
:tags '(unit)
(let ((x (fakir-test-mock-process)))
(should (equal
'(15 30)
x))))

(ert-deftest fakir-mock-process-delete ()
"Test the delete handling."
:tags '(unit)
;; delete-process causes the body to return :mock-process-finished
(should
(fakir-mock-process
:fakeproc
((a 20)
(:somevar "somevar"))
(let ((x "a string of text"))
(delete-process :fakeproc))))
;; How to use catch inside the BODY to handle delete-process
(should
(equal
"the process finished"
(fakir-mock-process
:fakeproc
((a 20)
(:somevar "somevar"))
(let ((x "a string of text"))
(when (eq :mock-process-finished
(catch :mock-process-finished
(delete-process :fakeproc)))
"the process finished"))))))

(ert-deftest fakir-mock-proc-properties ()
"A very quick function to test mocking process macro."
(let ((somevalue 30))
Expand Down Expand Up @@ -155,6 +122,30 @@ work. That seems better than trying to use a binary."
(delete-process myproc)))))
'(t t 15 10 t))))

(ert-deftest fakir-mock-process-delete ()
"Test the delete handling."
:tags '(unit)
;; delete-process causes the body to return :mock-process-finished
(should
(fakir-mock-process
:fakeproc
((a 20)
(:somevar "somevar"))
(let ((x "a string of text"))
(delete-process :fakeproc))))
;; How to use catch inside the BODY to handle delete-process
(should
(equal
"the process finished"
(fakir-mock-process
:fakeproc
((a 20)
(:somevar "somevar"))
(let ((x "a string of text"))
(when (eq :mock-process-finished
(catch :mock-process-finished
(delete-process :fakeproc)))
"the process finished"))))))

(ert-deftest fakir--file-fqn ()
"Test we can make fully qualified names for files."
Expand Down

0 comments on commit d9de8e0

Please sign in to comment.