forked from etu/webpaste.el
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Elis Axelsson
committed
Jun 3, 2017
1 parent
95de0b8
commit d475f02
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
;;; 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 my test text" :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/Dj5w") | ||
:return-value nil))))) | ||
|
||
|
||
;;; test-webpaste-providers.el ends here |