diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-05-31 16:37:09 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-05-31 16:37:09 +0000 |
commit | ff5c7c8c40ba24431ec5c9cdad23ddb9963d2c67 (patch) | |
tree | d290a2887c2e388894feb33f39ddfc4bf7459312 /activesupport/test/core_ext | |
parent | 1edd21bb0288526fc3a79ac1f960f4d5e6e6a2f5 (diff) | |
download | rails-ff5c7c8c40ba24431ec5c9cdad23ddb9963d2c67.tar.gz rails-ff5c7c8c40ba24431ec5c9cdad23ddb9963d2c67.tar.bz2 rails-ff5c7c8c40ba24431ec5c9cdad23ddb9963d2c67.zip |
Added Date#change (like Time#change) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/date_ext_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb index 3557c11748..f9891c9358 100644 --- a/activesupport/test/core_ext/date_ext_test.rb +++ b/activesupport/test/core_ext/date_ext_test.rb @@ -21,4 +21,9 @@ class DateExtCalculationsTest < Test::Unit::TestCase def test_to_date assert_equal Date.new(2005, 2, 21), Date.new(2005, 2, 21).to_date end + + def test_change + assert_equal Date.new(2005, 2, 21), Date.new(2005, 2, 11).change(:day => 21) + assert_equal Date.new(2007, 5, 11), Date.new(2005, 2, 11).change(:year => 2007, :month => 5) + end end |