diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-02-07 21:09:23 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-02-07 21:09:23 +0000 |
commit | fbd7ec3c9f0b1a5327ead66e0ac11b1d1d509f70 (patch) | |
tree | 44a1b9f1edd73c882aafd3d4a9f168a54963a6e9 /activesupport/test | |
parent | 4a9fc4424ff7402326bf17c8bfd89bf6cbc42c8c (diff) | |
download | rails-fbd7ec3c9f0b1a5327ead66e0ac11b1d1d509f70.tar.gz rails-fbd7ec3c9f0b1a5327ead66e0ac11b1d1d509f70.tar.bz2 rails-fbd7ec3c9f0b1a5327ead66e0ac11b1d1d509f70.zip |
Added Base64.encode64s to encode values in base64 without the newlines. This makes the values immediately usable as URL parameters or memcache keys without further processing [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8816 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/base64_ext_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/base64_ext_test.rb b/activesupport/test/core_ext/base64_ext_test.rb new file mode 100644 index 0000000000..aafbbd8539 --- /dev/null +++ b/activesupport/test/core_ext/base64_ext_test.rb @@ -0,0 +1,8 @@ +require 'abstract_unit' + +class Base64Test < Test::Unit::TestCase + def test_no_newline_in_encoded_value + assert_match /\n/, Base64.encode64("oneverylongstringthatwouldnormallybesplitupbynewlinesbytheregularbase64") + assert_no_match /\n/, Base64.encode64s("oneverylongstringthatwouldnormallybesplitupbynewlinesbytheregularbase64") + end +end |