[DRE-commits] [ruby-sanitize] 04/05: Make tests run

Balasankar C balasankarc-guest at moszumanska.debian.org
Thu Feb 25 06:08:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

balasankarc-guest pushed a commit to branch master
in repository ruby-sanitize.

commit e028aeba7d62527910d4499f7be16f4fb5865c4f
Author: Balasankar C <balasankarc at autistici.org>
Date:   Thu Feb 25 11:33:58 2016 +0530

    Make tests run
---
 debian/patches/fix-tests-sanitize.patch | 25 +++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 debian/ruby-test-files.yaml             |  2 --
 debian/ruby-tests.rake                  |  6 ++++++
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/debian/patches/fix-tests-sanitize.patch b/debian/patches/fix-tests-sanitize.patch
new file mode 100644
index 0000000..1ff843e
--- /dev/null
+++ b/debian/patches/fix-tests-sanitize.patch
@@ -0,0 +1,25 @@
+Description: Fix tests to support Debian's nokogiri syntax.
+ Debian's nokogiri (since they don't use patched libxml2 that upstream does)
+ escapes '<' and '>' to canonical forms and doesn't remove them. Tests should
+ be tweaked to support this.
+Author: Balasankar C <balasankarc at autistici.org>
+Last-Update: 2016-02-25
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/test/test_sanitize.rb
++++ b/test/test_sanitize.rb
+@@ -55,10 +55,10 @@
+ 
+   :malicious => {
+     :html       => '<b>Lo<!-- comment -->rem</b> <a href="javascript:pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <<foo>script>alert("hello world");</script>',
+-    :default    => 'Lorem ipsum dolor sit amet script>alert("hello world");',
+-    :restricted => '<b>Lorem</b> ipsum <strong>dolor</strong> sit amet script>alert("hello world");',
+-    :basic      => '<b>Lorem</b> <a rel="nofollow">ipsum</a> <a href="http://foo.com/" rel="nofollow"><strong>dolor</strong></a> sit<br>amet script>alert("hello world");',
+-    :relaxed    => '<b>Lorem</b> <a title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br>amet script>alert("hello world");'
++    :default    => 'Lorem ipsum dolor sit amet <script>alert("hello world");',
++    :restricted => '<b>Lorem</b> ipsum <strong>dolor</strong> sit amet <script>alert("hello world");',
++    :basic      => '<b>Lorem</b> <a rel="nofollow">ipsum</a> <a href="http://foo.com/" rel="nofollow"><strong>dolor</strong></a> sit<br>amet <script>alert("hello world");',
++    :relaxed    => '<b>Lorem</b> <a title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br>amet <script>alert("hello world");'
+   },
+ 
+   :raw_comment => {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8fcecb0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-tests-sanitize.patch
diff --git a/debian/ruby-test-files.yaml b/debian/ruby-test-files.yaml
deleted file mode 100644
index cbf00bd..0000000
--- a/debian/ruby-test-files.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- test/test_sanitize.rb
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
new file mode 100644
index 0000000..ba9133e
--- /dev/null
+++ b/debian/ruby-tests.rake
@@ -0,0 +1,6 @@
+require 'gem2deb/rake/testtask'
+
+Gem2Deb::Rake::TestTask.new do |t|
+  t.libs = ['test']
+  t.test_files = FileList['test/**/test_*.rb']
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-sanitize.git



More information about the Pkg-ruby-extras-commits mailing list