From 92f898f0a90760078a1bbfc843568e858891b6c9 Mon Sep 17 00:00:00 2001 From: Abhiseck Paira Date: Fri, 25 Feb 2022 20:42:48 +0530 Subject: test: add `mastodon-auth--user-unaware' Test for the situation when old mastodon.el users are unaware of the variable `mastodon-active-user'. --- test/mastodon-auth-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el index 3bf65b2..3ecac30 100644 --- a/test/mastodon-auth-tests.el +++ b/test/mastodon-auth-tests.el @@ -64,3 +64,11 @@ (should (equal mastodon-auth--token-alist '(("https://instance.url" . "foobaz"))))))) + +(ert-deftest mastodon-auth--user-unaware () + (let ((mastodon-instance-url "https://instance.url") + (mastodon-active-user nil) + (mastodon-auth--token-alist nil)) + (with-mock + (mock (mastodon-client--active-user)) + (should-error (mastodon-auth--access-token))))) -- cgit v1.2.3