aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/string_ext_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-02 13:07:02 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-02 13:07:02 +0000
commit6d688aa20c1075aa37134c2bfa9d7eae75f90437 (patch)
tree9e999a07d9453164e93327474fc3feacea4012b8 /activesupport/test/core_ext/string_ext_test.rb
parent7093c9aaab514398e757cb22a44d134cbab95068 (diff)
downloadrails-6d688aa20c1075aa37134c2bfa9d7eae75f90437.tar.gz
rails-6d688aa20c1075aa37134c2bfa9d7eae75f90437.tar.bz2
rails-6d688aa20c1075aa37134c2bfa9d7eae75f90437.zip
Added String#to_time and String#to_date for wrapping ParseDate
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/string_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index 74a4010f91..f394509dd1 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -61,4 +61,10 @@ class StringInflectionsTest < Test::Unit::TestCase
assert_equal(class_name, table_name.classify)
end
end
+
+ def test_string_to_time
+ assert_equal Time.utc(2005, 2, 27, 23, 50), "2005-02-27 23:50".to_time
+ assert_equal Time.local(2005, 2, 27, 23, 50), "2005-02-27 23:50".to_time(:local)
+ assert_equal Date.new(2005, 2, 27), "2005-02-27".to_date
+ end
end