1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- (require 'ob-sed)
- (org-test-for-executable "sed")
- (unless (featurep 'ob-sed)
- (signal 'missing-test-dependency "Support for Sed code blocks"))
- (ert-deftest ob-sed-test/simple-execution-of-script ()
- "Test simple execution of script."
- (org-test-at-id "C7E7CA6A-2601-42C9-B534-4102D62E458D"
- (org-babel-next-src-block)
- (should (string= "A processed sentence."
- (org-babel-execute-src-block)))))
- (ert-deftest ob-sed-test/in-file-header-argument ()
- "Test :in-file header argument."
- (org-test-at-id "54EC49AA-FE9F-4D58-812E-00FC87FAF562"
- (let ((default-directory temporary-file-directory))
- (with-temp-buffer
- (insert "A test file.")
- (write-file "test1.txt"))
- (org-babel-next-src-block)
- (should (string= "A tested file."
- (org-babel-execute-src-block))))))
- (ert-deftest ob-sed-test/cmd-line-header-argument ()
- "Test :cmd-line header argument."
- (org-test-at-id "E3C6A8BA-39FF-4840-BA8E-90D5C4365AB1"
- (let ((default-directory temporary-file-directory))
- (with-temp-buffer
- (insert "A test file.")
- (write-file "test2.txt"))
- (org-babel-next-src-block)
- (org-babel-execute-src-block)
- (should (string= "A tested again file.\n"
- (with-temp-buffer
- (insert-file-contents "test2.txt")
- (buffer-string)))))))
|