Sha256: 8b8f58c6f05da71f22effdd99ecf7d0bd609f8ac99af2eaf928ab34d85d3e8cf

Contents?: true

Size: 1.76 KB

Versions: 13

Compression:

Stored size: 1.76 KB

Contents

#- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license

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

describe RiCal::Component::Calendar do

  context ".entity_name" do
    it "should be VCALENDAR" do
      RiCal::Component::Calendar.entity_name.should == "VCALENDAR"
    end
  end
  
  context "a new instance" do
    before(:each) do
      @it = RiCal.Calendar
    end
    
    it "should have a tz_source of 'TZ_INFO" do
      @it.tz_source.should == "TZINFO"
    end
    
    it "should export a product id with an X-RICAL-TZSOURCE parameter of TZINFO" do
      @it.export.should match(%r{\nPRODID;X-RICAL-TZSOURCE=TZINFO:-//com.denhaven2/NONSGML ri_cal gem//EN\n})
    end
  end
  
  context "an imported instance with a tzinfo source" do
    before(:each) do
      @it = RiCal.parse_string("BEGIN:VCALENDAR\nPRODID;X-RICAL-TZSOURCE=TZINFO:-\/\/com.denhaven2\/NONSGML ri_cal gem\/\/EN\nCALSCALE:GREGORIAN\nVERSION:2.0\nEND:VCALENDAR\n").first
    end
    
    it "should have a tz_source of 'TZ_INFO" do
      @it.tz_source.should == "TZINFO"
    end
    
    it "should export a product id with an X-RICAL-TZSOURCE parameter of TZINFO" do
      @it.export.should match(%r{\nPRODID;X-RICAL-TZSOURCE=TZINFO:-//com.denhaven2/NONSGML ri_cal gem//EN\n})
    end
  end
  
  context "an imported instance without a tzinfo source" do
    before(:each) do
      @it = RiCal.parse_string("BEGIN:VCALENDAR\nPRODID:-//Apple Inc.//iCal 3.0//EN\nEND:VCALENDAR\n").first
    end
    
    it "should have a tz_source of nil" do
      @it.tz_source.should be_nil
    end
    
    it "should export not export a product id with an X-RICAL-TZSOURCE parameter of TZINFO" do
      @it.export.should_not match(%r{X-RICAL-TZSOURCE=TZINFO:})
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
rubyredrick-ri_cal-0.0.10 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.11 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.3 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.4 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.5 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.6 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.7 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.8 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.0.9 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.5.0 spec/ri_cal/component/calendar_spec.rb
rubyredrick-ri_cal-0.5.1 spec/ri_cal/component/calendar_spec.rb
ri_cal-0.5.0 spec/ri_cal/component/calendar_spec.rb
ri_cal-0.5.1 spec/ri_cal/component/calendar_spec.rb