[DRE-commits] [ruby-logging] 02/03: Backport 7b1f872 to fix failures when LANG=C
Hleb Valoshka
tsfgnu-guest at moszumanska.debian.org
Wed Jul 22 18:30:44 UTC 2015
This is an automated email from the git hooks/post-receive script.
tsfgnu-guest pushed a commit to branch patch-queue/master
in repository ruby-logging.
commit 6916bf6d2d7dd8163084be20c5ce90a086dde46a
Author: Hleb Valoshka <375gnu at gmail.com>
Date: Wed Jul 15 12:38:01 2015 +0300
Backport 7b1f872 to fix failures when LANG=C
---
test/appenders/test_buffered_io.rb | 9 ++++++---
test/appenders/test_file.rb | 3 +--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/test/appenders/test_buffered_io.rb b/test/appenders/test_buffered_io.rb
index 8b7e850..62642b4 100644
--- a/test/appenders/test_buffered_io.rb
+++ b/test/appenders/test_buffered_io.rb
@@ -10,9 +10,12 @@ module TestAppenders
def setup
super
- @appender = Logging.appenders.string_io(
- 'test_appender', :auto_flushing => 3, :immediate_at => :error
- )
+ @appender = Logging.appenders.string_io \
+ 'test_appender',
+ :auto_flushing => 3,
+ :immediate_at => :error,
+ :encoding => 'UTF-8'
+
@appender.clear
@sio = @appender.sio
@levels = Logging::LEVELS
diff --git a/test/appenders/test_file.rb b/test/appenders/test_file.rb
index a71f4bd..a31dd89 100644
--- a/test/appenders/test_file.rb
+++ b/test/appenders/test_file.rb
@@ -100,14 +100,13 @@ module TestAppenders
def test_encoding
log = File.join(TMP, 'file-encoding.log')
- #appender = Logging.appenders.file(NAME, :filename => log, :encoding => 'ISO-8859-16')
appender = Logging.appenders.file(NAME, :filename => log, :encoding => 'ASCII')
appender << "A normal line of text\n"
appender << "ümlaut\n"
appender.close
- lines = File.readlines(log)
+ lines = File.readlines(log, :encoding => 'UTF-8')
assert_equal "A normal line of text\n", lines[0]
assert_equal "ümlaut\n", lines[1]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-logging.git
More information about the Pkg-ruby-extras-commits
mailing list