diff options
author | Johnson Denen <johnson.denen@gmail.com> | 2017-04-23 01:14:18 -0400 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-04-23 11:09:06 -0400 |
commit | 993fbec64edf128ba9e5a1aa61f93c385fe3be31 (patch) | |
tree | 02ebed1a77f3e7e4e3893d3ddf335bb3aac6358b /test/mastodon-tl-tests.el | |
parent | 950a71a7e89efe48804a89322f9a974610d40770 (diff) |
Clean up tests and update DOCSTRINGs
Diffstat (limited to 'test/mastodon-tl-tests.el')
-rw-r--r-- | test/mastodon-tl-tests.el | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el index 19d7e55..9c45abd 100644 --- a/test/mastodon-tl-tests.el +++ b/test/mastodon-tl-tests.el @@ -1,15 +1,11 @@ (require 'el-mock) -(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 remove-html-1 () + "Should remove all <span> tags." + (let ((input "<span class=\"h-card\">foobar</span> <span>foobaz</span>")) + (should (string= (mastodon-tl--remove-html input) "foobar foobaz")))) -(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")))) +(ert-deftest remove-html-2 () + "Should replace <\p> tags with two new lines." + (let ((input "foobar</p>")) + (should (string= (mastodon-tl--remove-html input) "foobar\n\n")))) |