Sha256: 4d13d8aab8c445e2e463a54dc617a78dc262a63ca47fd2d3512ac6878c4bf794

Contents?: true

Size: 947 Bytes

Versions: 1

Compression:

Stored size: 947 Bytes

Contents

#- ©2009 Rick DeNatale
#- All rights reserved

require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
require 'rubygems'
require 'tzinfo'

describe RiCal::Component::TZInfoTimezone do

  it "should produce an rfc representation" do
    tz = RiCal::Component::TZInfoTimezone.new(TZInfo::Timezone.get("America/New_York"))
    local_first = DateTime.parse("Apr 10, 2007")
    local_last = DateTime.parse("Apr 6, 2008")
    utc_first = tz.local_to_utc(local_first)
    utc_last = tz.local_to_utc(local_last)
    rez = tz.to_rfc2445_string(utc_first, utc_last)
    rez.should == <<-ENDDATA
BEGIN:VTIMEZONE
TZID;X-RICAL-TZSOURCE=TZINFO:America/New_York
BEGIN:DAYLIGHT
DTSTART:20070311T030000
RDATE:20070311T030000,20080309T030000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20071104T010000
RDATE:20071104T010000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
END:VTIMEZONE
ENDDATA
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyredrick-ri_cal-0.0.2 spec/ri_cal/component/t_z_info_timezone_spec.rb