summaryrefslogtreecommitdiff
path: root/test/tc_converters_html2text.rb
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-03-31 22:08:32 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-03-31 22:08:32 +0000
commit16ec9aba7e94e628f22bcaeb3ecdd7916f3a3df5 (patch)
treefcee2e08574f55e141eeea3cb2747a4a80c04d89 /test/tc_converters_html2text.rb
parent94c2f3339fbe18700fcc057367784d04bb2a76d9 (diff)
downloadfeed2imap-16ec9aba7e94e628f22bcaeb3ecdd7916f3a3df5.tar.gz
feed2imap-16ec9aba7e94e628f22bcaeb3ecdd7916f3a3df5.tar.bz2
feed2imap-16ec9aba7e94e628f22bcaeb3ecdd7916f3a3df5.zip
first import
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@5 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to '')
-rwxr-xr-xtest/tc_converters_html2text.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/tc_converters_html2text.rb b/test/tc_converters_html2text.rb
new file mode 100755
index 0000000..4210a32
--- /dev/null
+++ b/test/tc_converters_html2text.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/ruby -w
+
+$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
+
+require 'test/unit'
+require 'feed2imap/textconverters'
+
+class TextConvertersHTML2TextTest < Test::Unit::TestCase
+ def test_t1
+ inputtext = <<-EOF
+<p> Ceci est un test. <br> On verra <b>bien</b> ce que ça donne ...</p>
+ EOF
+ outputtext = "Ceci est un test.
+On verra bien ce que ça donne ..."
+ assert_equal(outputtext, inputtext.html2text)
+ end
+
+ def test_t2
+ inputtext = <<-EOF
+<p class="coucou"> Ceci est un test. On verra <b>bien</b> ce que ça donne ...</p>
+<p class="coucou"> Ceci est un test. On verra <b>bien</b> ce que ça donne ...</p>
+ EOF
+ outputtext = "Ceci est un test. On verra bien ce que ça donne ...\n\nCeci est un test. On verra bien ce que ça donne ..."
+ assert_equal(outputtext, inputtext.html2text)
+ end
+end