From 4685fa0c20fbf3e78eaad94756e0f4a644447a10 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 4 Jun 2007 19:49:13 +0000 Subject: String#to_time overflows to DateTime. Add String#to_datetime. Closes #8572. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/string_ext_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activesupport/test/core_ext') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index cd2d12c3b1..b588fadf4f 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -78,7 +78,10 @@ class StringInflectionsTest < Test::Unit::TestCase 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 DateTime.civil(2039, 2, 27, 23, 50), "2039-02-27 23:50".to_time + assert_equal Time.local_time(2039, 2, 27, 23, 50), "2039-02-27 23:50".to_time(:local) assert_equal Date.new(2005, 2, 27), "2005-02-27".to_date + assert_equal DateTime.civil(2039, 2, 27, 23, 50), "2039-02-27 23:50".to_datetime end def test_access -- cgit v1.2.3