aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-tl-tests.el
diff options
context:
space:
mode:
authorJohnson Denen <johnson.denen@gmail.com>2017-04-14 09:27:42 -0400
committerJohnson Denen <johnson.denen@gmail.com>2017-04-14 13:18:14 -0400
commitcb8502f9ee8c3c393ba44613519bd5490ecf9775 (patch)
tree69c63daa59fab34b5e8af79dcc2ba579fe09d395 /test/mastodon-tl-tests.el
parentf42d5e2666022c891f8561c24489bc52e9f4f642 (diff)
Retrieve home timeline with `mastodon' function
Diffstat (limited to 'test/mastodon-tl-tests.el')
-rw-r--r--test/mastodon-tl-tests.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
new file mode 100644
index 0000000..5571e70
--- /dev/null
+++ b/test/mastodon-tl-tests.el
@@ -0,0 +1,16 @@
+(require 'el-mock)
+(load-file "../lisp/mastodon-tl.el")
+
+(ert-deftest mastodon-tl:from-toot ()
+ "Should return the value for KEY in a list."
+ (should (string= (mastodon-tl--from-toot "foo" '(("foo" . "bar"))) "bar")))
+
+(ert-deftest mastodon-tl:remove-html:remove-p-and-span ()
+ "Should remove <p> and <span> tags that are not parsed by `html2text'."
+ (let ((input "<p>foo<span>bar</span></p>"))
+ (should (string= (mastodon-tl--remove-html input) "foobar\n"))))
+
+(ert-deftest mastodon-tl:remove-html:remove-hcard-span ()
+ "Should remove <span> tags with a class of 'h-card'."
+ (let ((input "<span class=\"h-card\">foobar</span>"))
+ (should (string= (mastodon-tl--remove-html input) "foobar"))))