Sha256: 20634358137393242720eeec4dcfe4bbbd2c137946c4c57f1bd3d0a3e7dad298

Contents?: true

Size: 1.47 KB

Versions: 36

Compression:

Stored size: 1.47 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])

# RFC 2445 Section 4.3.9 pp 39-40
describe RiCal::PropertyValue::Period do
  
  before(:each) do
    @start_dt = RiCal::PropertyValue::DateTime.new(nil, :value => "19970101T180000Z")
    @end_dt = RiCal::PropertyValue::DateTime.new(nil, :value => "19970102T070000Z")
    @duration = RiCal::PropertyValue::Duration.from_datetimes(nil, @start_dt.to_datetime, @end_dt.to_datetime)
  end
  
  describe "with an explicit period" do
    before(:each) do
      @it = RiCal::PropertyValue::Period.new(nil, :value => "#{@start_dt.value}/#{@end_dt.value}")
    end
    
    it "should have the correct dtstart value" do
      @it.dtstart.should == @start_dt
    end
    
    it "should have the correct dtend value" do
      @it.dtend.should == @end_dt
    end
    
    it "should have the correct duration value" do
      @it.duration.should == @duration
    end
  end
  
  describe "with a start time and period" do
    before(:each) do
      @it = RiCal::PropertyValue::Period.new(nil, :value => "#{@start_dt.value}/#{@duration.value}")
    end
    
    it "should have the correct dtstart value" do
      @it.dtstart.should == @start_dt
    end
    
    it "should have the correct dtend value" do
      @it.dtend.should == @end_dt
    end
    
    it "should have the correct duration value" do
      @it.duration.should == @duration
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
rubyredrick-ri_cal-0.0.10 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.11 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.3 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.4 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.5 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.6 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.7 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.8 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.0.9 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.5.0 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.5.1 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.5.2 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.5.3 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.6.0 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.6.1 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.6.2 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.6.3 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.7.0 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.7.1 spec/ri_cal/property_value/period_spec.rb
rubyredrick-ri_cal-0.7.2 spec/ri_cal/property_value/period_spec.rb