test-ob-tangle.el: Fix dirty repo state caused by testing

* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Kill modified buffer after test.

Another test is causing the modifications to be saved which leaves the
repo in a dirty state after testing.

Modified-by: Kyle Meyer <kyle@kyleam.com>
  Changed to kill a let-bound buffer rather than a buffer name.
This commit is contained in:
Kevin J. Foley 2020-05-26 20:42:54 -04:00 committed by Kyle Meyer
parent b51d129f3f
commit 7a2b785d6a
1 changed files with 11 additions and 6 deletions

View File

@ -384,12 +384,17 @@ another block
(ert-deftest ob-tangle/detangle-false-positive ()
"Test handling of false positive link during detangle."
(org-test-in-example-file (expand-file-name "babel.el" org-test-example-dir)
(org-babel-detangle)
(org-test-at-id "73115FB0-6565-442B-BB95-50195A499EF4"
(org-babel-next-src-block)
(should (equal (string-trim (org-element-property :value (org-element-at-point)))
";; detangle changes")))))
(let (buffer)
(unwind-protect
(org-test-in-example-file (expand-file-name "babel.el" org-test-example-dir)
(org-babel-detangle)
(org-test-at-id "73115FB0-6565-442B-BB95-50195A499EF4"
(setq buffer (current-buffer))
(org-babel-next-src-block)
(should (equal (string-trim (org-element-property
:value (org-element-at-point)))
";; detangle changes"))))
(kill-buffer buffer))))
(provide 'test-ob-tangle)