Sha256: 60e14ac6e5fb7c75710170db58bfa8536e81b4d74f5eca977a9b36a892dc14da

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require '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
friflaj_ri_cal-0.9.0 spec/ri_cal/property_value/utc_offset_spec.rb