Sha256: 4ab0f331065e1906bb239a3d531d198e8d1eb5883fc1940cf1bcce4f81d9fd8d

Contents?: true

Size: 1.14 KB

Versions: 60

Compression:

Stored size: 1.14 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::PropertyValue::UtcOffset do
  
  describe "with a positive sign and seconds" do
    before(:each) do
      @it = RiCal::PropertyValue::UtcOffset.new(nil, :value => "+013015")
    end
    
    it "should have +1 as its sign" do
      @it.sign.should == 1
    end
    
    it "should have 1 as its hours" do
      @it.hours.should == 1
    end
    
    it "should have 30 as its minutes" do
      @it.minutes.should == 30
    end
    
    it "should have 15 as its seconds" do
      @it.seconds.should == 15
    end    
  end
  
  describe "with seconds omitted" do
    before(:each) do
      @it = RiCal::PropertyValue::UtcOffset.new(nil, :value => "+0130")
    end
        
    it "should have 0 as its seconds" do
      @it.seconds.should == 0
    end    
  end
  describe "with a negative sign" do
    before(:each) do
      @it = RiCal::PropertyValue::UtcOffset.new(nil, :value => "-013015")
    end
    
    it "should have +1 as its sign" do
      @it.sign.should == -1
    end
    
  end
end

Version data entries

60 entries across 60 versions & 8 rubygems

Version Path
demingfactor-ri_cal-0.10.0 spec/ri_cal/property_value/utc_offset_spec.rb
demingfactor-ri_cal-0.9.0 spec/ri_cal/property_value/utc_offset_spec.rb
ebeigarts-ri_cal-0.8.1 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.10 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.11 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.3 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.4 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.5 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.6 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.7 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.8 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.0.9 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.5.0 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.5.1 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.5.2 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.5.3 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.6.0 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.6.1 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.6.2 spec/ri_cal/property_value/utc_offset_spec.rb
rubyredrick-ri_cal-0.6.3 spec/ri_cal/property_value/utc_offset_spec.rb