Sha256: 6338771587e7f85c619c39a4ad1514d0a7187ab1a046ef807a65fa180c796df9

Contents?: true

Size: 856 Bytes

Versions: 3

Compression:

Stored size: 856 Bytes

Contents

describe "Time" do

  describe "parsing an iso8601 formatted time to a Time object" do
    before do
      @time = Time.iso8601("2012-05-31T19:41:33Z")
    end

    it "should be a time" do
      @time.instance_of?(Time).should == true
    end

    it "should be converted to the local timezone automatically" do
      @time.zone.should == Time.now.zone
    end

    it "should have a valid year" do
      @time.utc.year.should == 2012
    end

    it "should have a valid month" do
      @time.utc.month.should == 5
    end

    it "should have a valid day" do
      @time.utc.day.should == 31
    end

    it "should have a valid hour" do
      @time.utc.hour.should == 19
    end

    it "should have a valid minute" do
      @time.utc.min.should == 41
    end

    it "should have a valid second" do
      @time.utc.sec.should == 33
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bubble-wrap-0.4.0 spec/core/time_spec.rb
bubble-wrap-0.3.1 spec/time_spec.rb
bubble-wrap-0.3.0 spec/time_spec.rb