Sha256: ae9ea23ee4e971838a5814f7ffb9211217b2fb2a2d3a86ed17ab57326c282a1b

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

#- ©2009 Rick DeNatale
#- All rights reserved

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

1 entries across 1 versions & 1 rubygems

Version Path
rubyredrick-ri_cal-0.0.2 spec/ri_cal/property_value/utc_offset_spec.rb