summaryrefslogtreecommitdiff
path: root/test/digest
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 13:08:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 13:08:07 +0000
commit7df8b94926b79f280ed0be387897fa3d0187fb44 (patch)
tree5721f9c1d9385a0b4e877263935a8d055f1d66ec /test/digest
parent36feefecb9db8f66dd228d4cfb3e185679dbdf0d (diff)
* test/with_diffent_ofs.rb (DifferentOFS): test suite for test
suites affected by $,. * test/digest/test_digest_extend.rb (TestDigestExtend): should not assume $, invariant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/digest')
-rw-r--r--test/digest/test_digest_extend.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/digest/test_digest_extend.rb b/test/digest/test_digest_extend.rb
index 9b8eda0..131f90d 100644
--- a/test/digest/test_digest_extend.rb
+++ b/test/digest/test_digest_extend.rb
@@ -1,7 +1,10 @@
require 'test/unit'
require 'digest'
+require_relative '../with_diffent_ofs.rb'
class TestDigestExtend < Test::Unit::TestCase
+ include DifferentOFS
+
class MyDigest < Digest::Class
def initialize(*arg)
super
@@ -20,7 +23,7 @@ class TestDigestExtend < Test::Unit::TestCase
alias << update
def finish
- (@buf.join.length % 256).chr
+ (@buf.join('').length % 256).chr
end
def reset
@@ -39,8 +42,8 @@ class TestDigestExtend < Test::Unit::TestCase
assert_equal('', Digest.hexencode(''))
assert_equal('0102', Digest.hexencode("\1\2"))
assert_equal(
- (0..0xff).to_a.map { |c| sprintf("%02x", c ) }.join,
- Digest.hexencode((0..0xff).to_a.map { |c| c.chr }.join)
+ (0..0xff).to_a.map { |c| sprintf("%02x", c ) }.join(''),
+ Digest.hexencode((0..0xff).to_a.map { |c| c.chr }.join(''))
)
end