aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorEugene Kenny <elkenny@gmail.com>2017-12-17 00:49:02 +0000
committerEugene Kenny <elkenny@gmail.com>2017-12-17 00:49:02 +0000
commitb9e7c676ca13e286a371dc1b4996d2c15c0461e8 (patch)
tree0e948db08809dbeedabd5b3540970137d7feada6 /activesupport/test
parent28d2968533c860e7e4a836d0440cf6b3b11ad11f (diff)
downloadrails-b9e7c676ca13e286a371dc1b4996d2c15c0461e8.tar.gz
rails-b9e7c676ca13e286a371dc1b4996d2c15c0461e8.tar.bz2
rails-b9e7c676ca13e286a371dc1b4996d2c15c0461e8.zip
Don't include ellipsis in truncated digest output
Using `truncate` to limit the length of the digest has the unwanted side effect of adding an ellipsis when the input is longer than the limit. Also: - Don't instantiate a new object for every digest - Rename the configuration option to `hash_digest_class` - Update the CHANGELOG entry to describe how to use the feature
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/digest_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/test/digest_test.rb b/activesupport/test/digest_test.rb
index 5dec75b9fe..83ff2a8d83 100644
--- a/activesupport/test/digest_test.rb
+++ b/activesupport/test/digest_test.rb
@@ -16,7 +16,7 @@ class DigestTest < ActiveSupport::TestCase
digest = ActiveSupport::Digest.hexdigest("hello friend")
assert_equal 32, digest.length
- assert_equal ::Digest::SHA1.hexdigest("hello friend").truncate(32), digest
+ assert_equal ::Digest::SHA1.hexdigest("hello friend")[0...32], digest
ensure
ActiveSupport::Digest.hash_digest_class = original_hash_digest_class
end