Permalink
Browse files

made tzinfo a development dependency

  • Loading branch information...
1 parent c4e374a commit bea3e417a8177bef4987d1ee49a9f2a8742b0693 @dewski dewski committed Feb 10, 2012
Showing with 12 additions and 9 deletions.
  1. +1 −1 Gemfile.lock
  2. +1 −1 json_builder.gemspec
  3. +5 −3 lib/json_builder/extensions.rb
  4. +3 −2 test/test_helper.rb
  5. +2 −2 test/value_test.rb
View
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit bea3e41

Please sign in to comment.