Changeset 9079
- Timestamp:
- 03/22/08 18:43:36 (4 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/time_with_zone.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_with_zone_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r9071 r9079 1 1 *SVN* 2 3 * Ensure correct TimeWithZone#to_date [Geoff Buesing] 2 4 3 5 * Make TimeWithZone work with tzinfo 0.2.x: use TZInfo::Timezone#zone_identifier alias for #abbreviation, silence warnings on tests. Raise LoadError when TZInfo version is < 0.2 by sniffing for TZInfo::TimeOrDateTime constant. Move all tzinfo-dependent TimeZone tests into uses_tzinfo block [Geoff Buesing] trunk/activesupport/lib/active_support/time_with_zone.rb
r9071 r9079 140 140 end 141 141 142 %w(asctime day hour min mon sec usec wday yday year ).each do |name|142 %w(asctime day hour min mon sec usec wday yday year to_date).each do |name| 143 143 define_method(name) do 144 144 time.__send__(name) trunk/activesupport/test/core_ext/time_with_zone_test.rb
r9071 r9079 255 255 assert_equal @twz, @twz.to_time 256 256 end 257 258 def test_to_date 259 silence_warnings do # silence warnings raised by tzinfo gem 260 # 1 sec before midnight Jan 1 EST 261 assert_equal Date.new(1999, 12, 31), ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 1, 4, 59, 59), TimeZone['Eastern Time (US & Canada)'] ).to_date 262 # midnight Jan 1 EST 263 assert_equal Date.new(2000, 1, 1), ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 1, 5, 0, 0), TimeZone['Eastern Time (US & Canada)'] ).to_date 264 # 1 sec before midnight Jan 2 EST 265 assert_equal Date.new(2000, 1, 1), ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 2, 4, 59, 59), TimeZone['Eastern Time (US & Canada)'] ).to_date 266 # midnight Jan 2 EST 267 assert_equal Date.new(2000, 1, 2), ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 2, 5, 0, 0), TimeZone['Eastern Time (US & Canada)'] ).to_date 268 end 269 end 257 270 258 271 def test_to_datetime