[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste ddd2fca 186/298: Added tests for success lambdas
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste ddd2fca 186/298: Added tests for success lambdas |
Date: |
Thu, 9 Dec 2021 19:00:11 -0500 (EST) |
branch: elpa/webpaste
commit ddd2fcacf4bfe239994b31fcd1685371eb8e7fb0
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Added tests for success lambdas
---
tests/unit/test-webpaste-success-lambdas.el | 50 +++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/tests/unit/test-webpaste-success-lambdas.el
b/tests/unit/test-webpaste-success-lambdas.el
new file mode 100644
index 0000000..ab4a0d5
--- /dev/null
+++ b/tests/unit/test-webpaste-success-lambdas.el
@@ -0,0 +1,50 @@
+;;; test-webpaste-success-lambdas.el --- Tests for success lambdas
+;;; Commentary:
+;;; Code:
+
+(load "tests/load-undercover.el")
+(require 'webpaste)
+
+
+(describe
+ "Create lambdas to use on successes"
+
+ (before-each
+ (spy-on 'request-response-header :and-return-value "https://example.com/")
+ (spy-on 'request-response-url :and-return-value "https://example.com/")
+ (spy-on 'webpaste-return-url))
+
+ (it
+ "using a response header"
+
+ (let ((success-lambda (webpaste/providers-success-location-header)))
+ (funcall success-lambda :response "my fake response")
+
+ (expect 'webpaste-return-url
+ :to-have-been-called-with
+ "https://example.com/")))
+
+
+ (it
+ "when using some request.el response thingy"
+ (let ((success-lambda (webpaste/providers-success-response-url)))
+ (funcall success-lambda :response "my fake response")
+
+ (expect 'webpaste-return-url
+ :to-have-been-called-with
+ "https://example.com/")))
+
+
+ (it
+ "when returning a string with an url"
+
+ (let ((success-lambda (webpaste/providers-success-returned-string)))
+ (funcall success-lambda :data "\"https://example.com/\"
+")
+
+ (expect 'webpaste-return-url
+ :to-have-been-called-with
+ "https://example.com/"))))
+
+
+;;; test-webpaste-success-lambdas.el ends here
- [nongnu] elpa/webpaste 865ff10 159/298: Disable this test for now since it breaks, (continued)
- [nongnu] elpa/webpaste 865ff10 159/298: Disable this test for now since it breaks, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 59fd22f 161/298: Merge branch 'naclander-POST-bug', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d475f02 170/298: Added integration test for ptpb.pw, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 95de0b8 169/298: Remove sync as a provider parameter on creation and add it on execution, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste fd4332a 172/298: Merge branch 'test-providers-on-travis', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 60c0a98 167/298: Added printing of travis event type, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d0442ad 168/298: Renamed all unit tests to make it easier for integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cac4979 173/298: Added option to send returned URL to clpboard, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste db393a1 175/298: Merge branch 'naclander-copy-to-clipboard', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 92f309e 188/298: Added a contributing guidelines file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste ddd2fca 186/298: Added tests for success lambdas,
ELPA Syncer <=
- [nongnu] elpa/webpaste 2a05d02 194/298: Added supports for custom hooks when returning URLs. This fixes #22., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b96e411 204/298: Moved the paste message to be a variable used for all integration tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 26f089e 201/298: Rename webpaste-paste-text and webpaste-paste-text-to-provider to be in "private scope", ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 90a96d2 199/298: Change emacs-lisp-mode from elisp to clojure for sprunge.us, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4b32baa 203/298: Rename all the lambdas to private scopes, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cc9ba3d 202/298: Begin autoloading of the webpaste group, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste aed3e00 210/298: Bump version for new release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b8f300f 209/298: Add pattern for buttercup to not run gists.github.com on travis, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4bd15f8 227/298: Add a nix-shell file for some development utils, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f047313 219/298: Update the custom hook example to actually need to be a lambda, ELPA Syncer, 2021/12/09