diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2018-03-01 21:09:24 -0800 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2018-03-01 22:42:51 -0800 |
commit | 4b42c7e52aa23081ce02ffad53c76ab786214e87 (patch) | |
tree | 3ce3c19d1b336c490cdbf2d8a5f93716480f1939 /activesupport/test | |
parent | 6a029624009eee9fab04c186ccbe06862f5a231f (diff) | |
download | rails-4b42c7e52aa23081ce02ffad53c76ab786214e87.tar.gz rails-4b42c7e52aa23081ce02ffad53c76ab786214e87.tar.bz2 rails-4b42c7e52aa23081ce02ffad53c76ab786214e87.zip |
Ruby 2.4: take advantage of String#unpack1
https://bugs.ruby-lang.org/issues/12752
https://ruby-doc.org/core-2.4.0/String.html#method-i-unpack1
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/key_generator_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/test/key_generator_test.rb b/activesupport/test/key_generator_test.rb index a948cfbd8e..cdde2c573a 100644 --- a/activesupport/test/key_generator_test.rb +++ b/activesupport/test/key_generator_test.rb @@ -36,13 +36,13 @@ else # key would break. expected = "b129376f68f1ecae788d7433310249d65ceec090ecacd4c872a3a9e9ec78e055739be5cc6956345d5ae38e7e1daa66f1de587dc8da2bf9e8b965af4b3918a122" - assert_equal expected, ActiveSupport::KeyGenerator.new("0" * 64).generate_key("some_salt").unpack("H*").first + assert_equal expected, ActiveSupport::KeyGenerator.new("0" * 64).generate_key("some_salt").unpack1("H*") expected = "b129376f68f1ecae788d7433310249d65ceec090ecacd4c872a3a9e9ec78e055" - assert_equal expected, ActiveSupport::KeyGenerator.new("0" * 64).generate_key("some_salt", 32).unpack("H*").first + assert_equal expected, ActiveSupport::KeyGenerator.new("0" * 64).generate_key("some_salt", 32).unpack1("H*") expected = "cbea7f7f47df705967dc508f4e446fd99e7797b1d70011c6899cd39bbe62907b8508337d678505a7dc8184e037f1003ba3d19fc5d829454668e91d2518692eae" - assert_equal expected, ActiveSupport::KeyGenerator.new("0" * 64, iterations: 2).generate_key("some_salt").unpack("H*").first + assert_equal expected, ActiveSupport::KeyGenerator.new("0" * 64, iterations: 2).generate_key("some_salt").unpack1("H*") end end |