diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-26 15:47:41 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-26 15:47:41 -0200 |
commit | 962629877d5adf75c3e5464f2d6a61b7f2fccc61 (patch) | |
tree | b316199d5d6e6722e6e66d1e7795943c5ecb3877 /test/test-api.el | |
parent | b413d048be63e2981e1d1069d86c83de0ed1ef87 (diff) | |
parent | 75c4a7d4e02e81c42a4914e2b798f60415a3b505 (diff) |
Merge branch 'images' into handle-html-tags
Diffstat (limited to 'test/test-api.el')
-rw-r--r-- | test/test-api.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/test-api.el b/test/test-api.el index 0715a2e..faf2e0a 100644 --- a/test/test-api.el +++ b/test/test-api.el @@ -18,12 +18,19 @@ (ert-deftest request-get-url () (should (sx-request-get-url "http://google.com")) (should-error (sx-request-get-url "http://github.com/Bruce-Connor/does-not-exist")) - (should - ;; If image is not recognized, this returns nil. - (create-image (sx-request-get-url "https://raw.githubusercontent.com/vermiculus/sx.el/master/list-and-question.png") - 'imagemagick t - :width (min sx-question-mode-image-max-width - (window-body-width nil 'pixel))))) + (when sx-question-mode-use-images + (should + ;; If image is not recognized, this returns nil. + (create-image (sx-request-get-url "https://raw.githubusercontent.com/vermiculus/sx.el/master/list-and-question.png") + 'imagemagick t + :width sx-question-mode-image-max-width))) + ;; In case imagemacgick is not available, let's try png so we at + ;; least test the function. + (when (image-type-available-p 'png) + (should + (create-image (sx-request-get-url "https://raw.githubusercontent.com/vermiculus/sx.el/master/list-and-question.png") + 'png t + :width sx-question-mode-image-max-width)))) (ert-deftest request-get-data () (should-error (sx-request-get-data "tags/emacs-does-not-exist")) |