aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json/encoding_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-18 21:20:35 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-18 21:20:35 +0000
commitfd15359104afbdf86f86a1c1f9b424b855fb3071 (patch)
tree3338bc227030570f2bd899424a3ebbf4301691ae /activesupport/test/json/encoding_test.rb
parentd2acf8b548b56966da49bd7f2f92dcfbd5410319 (diff)
downloadrails-fd15359104afbdf86f86a1c1f9b424b855fb3071.tar.gz
rails-fd15359104afbdf86f86a1c1f9b424b855fb3071.tar.bz2
rails-fd15359104afbdf86f86a1c1f9b424b855fb3071.zip
Date, Time, and DateTime#to_json. Closes #8399.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/json/encoding_test.rb')
-rw-r--r--activesupport/test/json/encoding_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index 149d11ce0f..dbb96cb38c 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -29,6 +29,10 @@ class TestJSONEncoding < Test::Unit::TestCase
[ ActiveSupport::JSON::Variable.new('alert("foo")'), 'alert("foo")']]
RegexpTests = [[ /^a/, '/^a/' ], [/^\w{1,2}[a-z]+/ix, '/^\\w{1,2}[a-z]+/ix']]
+ DateTests = [[ Date.new(2005,1,1), %("01/01/2005") ]]
+ TimeTests = [[ Time.at(0), %("12/31/1969 16:00:00 #{Time.at(0).zone}") ]]
+ DateTimeTests = [[ Time.at(0), %("12/31/1969 16:00:00 #{Time.at(0).zone}") ]]
+
constants.grep(/Tests$/).each do |class_tests|
define_method("test_#{class_tests[0..-6].downcase}") do
self.class.const_get(class_tests).each do |pair|