Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made tzinfo a development dependency

  • Loading branch information...
commit bea3e417a8177bef4987d1ee49a9f2a8742b0693 1 parent c4e374a
@dewski dewski authored
View
2  Gemfile.lock
@@ -3,7 +3,6 @@ PATH
specs:
json_builder (3.0.7)
activesupport (>= 2.0.0)
- tzinfo
GEM
remote: http://rubygems.org/
@@ -22,3 +21,4 @@ DEPENDENCIES
i18n
json_builder!
rake
+ tzinfo
View
2  json_builder.gemspec
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.add_dependency 'activesupport', '>= 2.0.0'
- s.add_dependency 'tzinfo'
+ s.add_development_dependency 'tzinfo'
end
View
8 lib/json_builder/extensions.rb
@@ -30,9 +30,11 @@ def to_builder
end
end
-class ActiveSupport::TimeWithZone
- def to_builder
- iso8601.inspect
+module ActiveSupport
+ class TimeWithZone
+ def to_builder
+ iso8601.inspect
+ end
end
end
View
5 test/test_helper.rb
@@ -8,14 +8,15 @@
$TESTING = true
require 'test/unit'
require 'json_builder'
+require 'tzinfo'
class Dozer
attr_accessor :value
-
+
def initialize(value)
@value = value
end
-
+
def to_builder
@value.reverse.inspect
end
View
4 test/value_test.rb
@@ -42,12 +42,12 @@ def test_time_value
end
def test_time_with_zone_value
- Time.zone = "CET"
+ Time.zone = 'CET'
assert_equal '"2012-01-01T00:00:00+01:00"', value(Time.zone.local(2012))
end
+ # This will be the local time zone offset, hence the wildcard.
def test_date_value
- # This will be the local time zone offset, hence the wildcard.
assert_match /"2012-01-01T00:00:00.*/, value(Date.parse('2012-01-01'))
end
Please sign in to comment.
Something went wrong with that request. Please try again.