summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2017-01-22 01:46:32 +0100
committerManuel Rüger <mrueg@gentoo.org>2017-01-22 01:46:32 +0100
commitafc0fa15411677a5f8e98dfa7cbf78735626c014 (patch)
tree78560117514bb6ffbc77d3c2970ae352482c9ef7 /dev-ruby/wikicloth
parentdev-ruby/wikicloth: Add ruby23, drop ruby20 (diff)
downloadgentoo-afc0fa15411677a5f8e98dfa7cbf78735626c014.tar.gz
gentoo-afc0fa15411677a5f8e98dfa7cbf78735626c014.tar.bz2
gentoo-afc0fa15411677a5f8e98dfa7cbf78735626c014.zip
dev-ruby/wikicloth: Apply patch to fix tests (partially)
Package-Manager: portage-2.3.3
Diffstat (limited to 'dev-ruby/wikicloth')
-rw-r--r--dev-ruby/wikicloth/files/wikicloth-0.8.3-fix-tests.patch68
-rw-r--r--dev-ruby/wikicloth/wikicloth-0.8.3.ebuild2
2 files changed, 70 insertions, 0 deletions
diff --git a/dev-ruby/wikicloth/files/wikicloth-0.8.3-fix-tests.patch b/dev-ruby/wikicloth/files/wikicloth-0.8.3-fix-tests.patch
new file mode 100644
index 000000000000..b50752a9ae9b
--- /dev/null
+++ b/dev-ruby/wikicloth/files/wikicloth-0.8.3-fix-tests.patch
@@ -0,0 +1,68 @@
+From 5c84028cadb36e7e2a220c7ab05398722c6d0e84 Mon Sep 17 00:00:00 2001
+From: Per Andersson <avtobiff@gmail.com>
+Date: Sat, 10 Oct 2015 22:33:58 +0200
+Subject: [PATCH 1/2] Update output assert in autolinking pre statement
+
+The <pre> tag doesn't keep html entities.
+---
+ test/wiki_cloth_test.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/wiki_cloth_test.rb b/test/wiki_cloth_test.rb
+index 2f0481a..483cecf 100644
+--- a/test/wiki_cloth_test.rb
++++ b/test/wiki_cloth_test.rb
+@@ -58,7 +58,7 @@ class WikiClothTest < Test::Unit::TestCase
+ test "autolinking keeps html entities intact" do
+ wiki = WikiCloth::Parser.new(:data => "<div>&amp; &gt;</div><pre>&amp; &lt;</pre> https://github.com/repo/README.md &gt; &amp;")
+ data = wiki.to_html
+- assert_equal "\n<p><div>&amp; &gt;</div><pre>&amp; &lt;</pre> <a href=\"https://github.com/repo/README.md\">https://github.com/repo/README.md</a> &gt; &amp;</p>", data
++ assert_equal "\n<p><div>&amp; &gt;</div><pre>&amp;amp&#59; &amp;lt&#59;</pre> <a href=\"https://github.com/repo/README.md\">https://github.com/repo/README.md</a> &gt; &amp;</p>", data
+ end
+
+ test "image url override" do
+
+From a7eccc2970b0f1b1973881fe139b1f2cb51af2eb Mon Sep 17 00:00:00 2001
+From: Per Andersson <avtobiff@gmail.com>
+Date: Sat, 10 Oct 2015 22:40:25 +0200
+Subject: [PATCH 2/2] Update output for table of content tests
+
+Newlines seems to have been removed from HTML output for TOC.
+
+* empty item in toc
+* toc declared as list
+* toc numbered
+---
+ test/wiki_cloth_test.rb | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/test/wiki_cloth_test.rb b/test/wiki_cloth_test.rb
+index 483cecf..198295c 100644
+--- a/test/wiki_cloth_test.rb
++++ b/test/wiki_cloth_test.rb
+@@ -446,7 +446,7 @@ class WikiClothTest < Test::Unit::TestCase
+ test "empty item in toc" do
+ wiki = WikiCloth::WikiCloth.new({:data => "__TOC__\n=A="})
+ data = wiki.render
+- assert data.include?("<table id=\"toc\" class=\"toc\" summary=\"Contents\"><tr><td>\n<div id=\"toctitle\"><h2>Table of Contents</h2></div>\n<ul><li><a href=\"#A\">A</a></li></ul>\n</td></tr></table>")
++ assert data.include?('<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div><ul></li><li><a href="#A">A</a></li></ul></td></tr></table>')
+ end
+
+ test "pre at beginning" do
+@@ -458,12 +458,14 @@ class WikiClothTest < Test::Unit::TestCase
+ test "toc declared as list" do
+ wiki = WikiCloth::WikiCloth.new({:data => "__TOC__\n=A=\n==B==\n===C==="})
+ data = wiki.render
+- assert data.include?("<table id=\"toc\" class=\"toc\" summary=\"Contents\"><tr><td>\n<div id=\"toctitle\"><h2>Table of Contents</h2></div>\n<ul><li>\n<a href=\"#A\">A</a><ul><li>\n<a href=\"#B\">B</a><ul><li><a href=\"#C\">C</a></li></ul>\n</li></ul>\n</li></ul>\n</td></tr></table>")
++ puts data
++ assert data.include?('<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div><ul></li><li><a href="#A">A</a><ul><li><a href="#B">B</a><ul><li><a href="#C">C</a></li></ul></ul></ul></td></tr></table>')
+ end
+
+ test "toc numbered" do
+ wiki = WikiCloth::WikiCloth.new({:data => "=A=\n=B=\n==C==\n==D==\n===E===\n===F===\n====G====\n====H====\n==I==\n=J=\n=K=\n===L===\n===M===\n====N====\n====O===="})
+ data = wiki.render(:noedit => true, :toc_numbered => true)
+- assert data.include?("<table id=\"toc\" class=\"toc\" summary=\"Contents\"><tr><td>\n<div id=\"toctitle\"><h2>Table of Contents</h2></div>\n<ul>\n<li><a href=\"#A\">1 A</a></li>\n<li>\n<a href=\"#B\">2 B</a><ul>\n<li><a href=\"#C\">2.1 C</a></li>\n<li>\n<a href=\"#D\">2.2 D</a><ul>\n<li><a href=\"#E\">2.2.1 E</a></li>\n<li>\n<a href=\"#F\">2.2.2 F</a><ul>\n<li><a href=\"#G\">2.2.2.1 G</a></li>\n<li><a href=\"#H\">2.2.2.2 H</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li><a href=\"#I\">2.3 I</a></li>\n</ul>\n</li>\n<li><a href=\"#J\">3 J</a></li>\n<li>\n<a href=\"#K\">4 K</a><ul><ul>\n<li><a href=\"#L\">4.1 L</a></li>\n<li>\n<a href=\"#M\">4.2 M</a><ul>\n<li><a href=\"#N\">4.2.1 N</a></li>\n<li><a href=\"#O\">4.2.2 O</a></li>\n</ul>\n</li>\n</ul></ul>\n</li>\n</ul>\n</td></tr></table>")
++ assert data.include?('<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div><ul></li><li><a href="#A">1 A</a></li><li><a href="#B">2 B</a><ul><li><a href="#C">2.1 C</a></li><li><a href="#D">2.2 D</a><ul><li><a href="#E">2.2.1 E</a></li><li><a href="#F">2.2.2 F</a><ul><li><a href="#G">2.2.2.1 G</a></li><li><a href="#H">2.2.2.2 H</a></li></ul></ul><li><a href="#I">2.3 I</a></li></ul><li><a href="#J">3 J</a></li><li><a href="#K">4 K</a><ul><ul><li><a href="#L">4.1 L</a></li><li><a href="#M">4.2 M</a><ul><li><a href="#N">4.2.1 N</a></li><li><a href="#O">4.2.2 O</a></li></ul></ul></ul></ul></td></tr></table>')
++
+ end
+ end
diff --git a/dev-ruby/wikicloth/wikicloth-0.8.3.ebuild b/dev-ruby/wikicloth/wikicloth-0.8.3.ebuild
index c60f14b42314..faf183d1d283 100644
--- a/dev-ruby/wikicloth/wikicloth-0.8.3.ebuild
+++ b/dev-ruby/wikicloth/wikicloth-0.8.3.ebuild
@@ -19,6 +19,8 @@ SLOT="0"
KEYWORDS="~amd64"
IUSE=""
+RUBY_PATCHES=( "${FILESDIR}"/${P}-fix-tests.patch )
+
ruby_add_rdepend "dev-ruby/builder:*
dev-ruby/expression_parser
dev-ruby/htmlentities