diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-01-23 16:17:56 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-01-23 16:17:56 +0530 |
commit | 912f14419076c26c1d281848b74048cfcfd1d85f (patch) | |
tree | 15b3b1c5376bc601eff53448f84a09ce62ec19d1 /activesupport/test/core_ext | |
parent | 70d81b319e5c18004065eba9e425041f48d24671 (diff) | |
download | rails-912f14419076c26c1d281848b74048cfcfd1d85f.tar.gz rails-912f14419076c26c1d281848b74048cfcfd1d85f.tar.bz2 rails-912f14419076c26c1d281848b74048cfcfd1d85f.zip |
test base64 encode and decode
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/base64_ext_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/base64_ext_test.rb b/activesupport/test/core_ext/base64_ext_test.rb index 544c990b3c..07052a366a 100644 --- a/activesupport/test/core_ext/base64_ext_test.rb +++ b/activesupport/test/core_ext/base64_ext_test.rb @@ -7,4 +7,13 @@ class Base64Test < Test::Unit::TestCase assert_no_match(/\n/, ActiveSupport::Base64.encode64s("oneverylongstringthatwouldnormallybesplitupbynewlinesbytheregularbase64")) end end + + def test_encode_and_decode + ActiveSupport::Deprecation.silence do + string = "foobar" + encoded_string = ActiveSupport::Base64.encode64(string) + assert_equal "Zm9vYmFy\n", encoded_string + assert_equal string, ActiveSupport::Base64.decode64(encoded_string) + end + end end |