You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
974 B
36 lines
974 B
;;; test-webpaste-providers.el --- Tests for webpaste providers |
|
;;; Commentary: |
|
;;; Code: |
|
|
|
(load "tests/load-undercover.el") |
|
(require 'webpaste) |
|
|
|
|
|
(describe |
|
"Test all providers with dummy data" |
|
|
|
(before-each |
|
;; Block requests |
|
(spy-on 'webpaste-paste-text) |
|
(spy-on 'webpaste-return-url)) |
|
|
|
(it |
|
"can paste with ptpb.pw" |
|
|
|
(let ((provider (cadr (assoc "ptpb.pw" webpaste-providers-alist)))) |
|
(funcall |
|
provider |
|
";; This is a build artifact made from an integration test for https://github.com/etu/webpaste.el" |
|
:sync t) |
|
|
|
(expect (spy-calls-count 'webpaste-return-url) :to-equal 1) |
|
(expect (spy-calls-count 'webpaste-paste-text) :to-equal 0) |
|
|
|
(expect (spy-calls-most-recent 'webpaste-return-url) |
|
:to-equal |
|
(make-spy-context :current-buffer (current-buffer) |
|
:args '("https://ptpb.pw/gLC6") |
|
:return-value nil))))) |
|
|
|
|
|
;;; test-webpaste-providers.el ends here
|
|
|