[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste 6a02ff9 185/298: Added tests for error lambdas an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste 6a02ff9 185/298: Added tests for error lambdas and failovers |
Date: |
Thu, 9 Dec 2021 19:00:11 -0500 (EST) |
branch: elpa/webpaste
commit 6a02ff96794f53148399ff4527142bb1face9377
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Added tests for error lambdas and failovers
---
tests/unit/test-webpaste-error-lambdas.el | 45 +++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/tests/unit/test-webpaste-error-lambdas.el
b/tests/unit/test-webpaste-error-lambdas.el
new file mode 100644
index 0000000..7891c7c
--- /dev/null
+++ b/tests/unit/test-webpaste-error-lambdas.el
@@ -0,0 +1,45 @@
+;;; test-webpaste-error-lambdas.el --- Tests for error lambdas
+;;; Commentary:
+;;; Code:
+
+(load "tests/load-undercover.el")
+(require 'webpaste)
+
+
+(describe
+ "Create lambdas to use on failures, "
+
+ (before-each
+ (spy-on 'webpaste-paste-text)
+ (spy-on 'message))
+
+ (it
+ "with fallback"
+
+ (let ((error-lambda (webpaste/providers-error-lambda :text "my text")))
+ (funcall error-lambda :error-thrown "my error")
+
+ (expect 'message
+ :to-have-been-called-with
+ "Got error: %S"
+ "my error")
+
+ (expect 'webpaste-paste-text
+ :to-have-been-called-with
+ "my text")))
+
+ (it
+ "without fallback"
+ (let ((error-lambda (webpaste/providers-error-lambda-no-failover :text "my
text")))
+ (funcall error-lambda :error-thrown "my error")
+
+ (expect 'message
+ :to-have-been-called-with
+ "Got error: %S"
+ "my error")
+
+ (expect 'webpaste-paste-text
+ :not :to-have-been-called))))
+
+
+;;; test-webpaste-error-lambdas.el ends here
- [nongnu] elpa/webpaste b96e411 204/298: Moved the paste message to be a variable used for all integration tests, (continued)
- [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
- [nongnu] elpa/webpaste ac24701 214/298: Merge branch 'DamienCassou-simplify-travis', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6a02ff9 185/298: Added tests for error lambdas and failovers,
ELPA Syncer <=
- [nongnu] elpa/webpaste bf08207 211/298: Update my name due to legal namechange, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 14fd97b 225/298: Add deprecation message of simpleclip option to clean up the code, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b6f8005 216/298: Do not fallback to true if test fails, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cd66756 241/298: Detect lang from shebang, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1787ea7 249/298: bugfix in "gist.github.com" entry of webpaste-providers-alist, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 9da4eca 258/298: travis: Switch to nix-emacs-ci, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7d08f87 254/298: integration-tests: Change filtering of local/ci provider tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste afbcf6f 273/298: Merge branch 'comfort-paste', ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4e410b0 272/298: Add example config to README with 'pasting buffer OR region' function, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0760361 278/298: docs: Fix all warnings regarding docstrings, ELPA Syncer, 2021/12/09