Sha256: a1ad49adf351308cf75acef57fcef26d21c65e4b3da57ab9f05d6cf65911e4ca

Contents?: true

Size: 638 Bytes

Versions: 4

Compression:

Stored size: 638 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "fos_dates" do

  it "converts fos date number to a Ruby Date" do
    Date.from_fos_days(10).should == Date.new(1900,1,10)
  end

  it "converts fos time number to a Ruby Time" do
    Time.from_fos_time(100).should ==  Time.utc(2000,"jan",1,1,40,0)
  end

  it "converts a Ruby Time to hundredths" do
    Time.from_fos_time(100).in_hundredths.should ==  "1.7"
  end

  it "Date view defaults to y-m-d" do
    Date.parse('Sept 9, 2009').to_s.should == "2009-09-09"
  end

  it "Time view defaults to M:H" do
    Time.parse('Sept 9, 2009 07:10').to_s.should == "07:10"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fossil-0.2.5 spec/sequel/fos_dates_spec.rb
fossil-0.2.4 spec/sequel/fos_dates_spec.rb
fossil-0.2.3 spec/sequel/fos_dates_spec.rb
fossil-0.2.2 spec/sequel/fos_dates_spec.rb