[DRE-commits] [ruby-libxml] 01/03: Add restore_internal_encoding.patch to avoid test failures related to encoding wrongly set

Cédric Boutillier boutil at moszumanska.debian.org
Sun Jul 3 16:50:06 UTC 2016


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

boutil pushed a commit to branch master
in repository ruby-libxml.

commit 0a91e93f1751fbd60bea8c380433d35f669ca9cb
Author: Cédric Boutillier <boutil at debian.org>
Date:   Sun Jul 3 18:42:06 2016 +0200

    Add restore_internal_encoding.patch to avoid test failures related to encoding wrongly set
---
 debian/patches/restore_internal_encoding.patch | 48 ++++++++++++++++++++++++++
 debian/patches/series                          |  1 +
 2 files changed, 49 insertions(+)

diff --git a/debian/patches/restore_internal_encoding.patch b/debian/patches/restore_internal_encoding.patch
new file mode 100644
index 0000000..a0ad226
--- /dev/null
+++ b/debian/patches/restore_internal_encoding.patch
@@ -0,0 +1,48 @@
+Description: restore default internal encoding after the tests
+Bug: https://github.com/xml4r/libxml-ruby/issues/123
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2016-07-03
+
+--- a/test/tc_encoding_sax.rb
++++ b/test/tc_encoding_sax.rb
+@@ -93,9 +93,14 @@
+ 
+ class TestEncodingSax < Minitest::Test
+   def setup
++    @backup_internal_encoding = Encoding.default_internal
+     Encoding.default_internal = nil
+   end
+ 
++  def teardown
++    Encoding.default_internal = @backup_internal_encoding
++  end
++
+   def file_for_encoding(encoding)
+     file_name = "model/bands.#{encoding.name.downcase}.xml"
+     File.join(File.dirname(__FILE__), file_name)
+@@ -112,4 +117,4 @@
+     parser.callbacks = SaxEncodingCallbacks.new
+     parser.parse
+   end
+-end
+\ No newline at end of file
++end
+--- a/test/tc_encoding.rb
++++ b/test/tc_encoding.rb
+@@ -20,10 +20,16 @@
+ #  http://en.wikipedia.org/wiki/List_of_Unicode_characters
+ 
+ class TestEncoding < Minitest::Test
++
+   def setup
++    @backup_internal_encoding = Encoding.default_internal
+     Encoding.default_internal = nil
+   end
+ 
++  def teardown
++    Encoding.default_internal = @backup_internal_encoding
++  end
++
+   def file_for_encoding(encoding)
+     file_name = "model/bands.#{encoding.name.downcase}.xml"
+     File.join(File.dirname(__FILE__), file_name)
diff --git a/debian/patches/series b/debian/patches/series
index 1e3c72c..3579bbb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 avoid_infinite_loop_ruby22.patch
 avoid_messing_with_loadpath.patch
 broken_tests.patch
+restore_internal_encoding.patch

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



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