Sha256: c9fc6059d6870a91b63a6f5be5d06cc7bc084172862efbcd2caccdf985170afc

Contents?: true

Size: 998 Bytes

Versions: 31

Compression:

Stored size: 998 Bytes

Contents

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

describe "fos_dates" do

  it "Time and DateTime have proper class methods included from TimeFunctions" do
    Time.should respond_to(:from_fos_time)
    DateTime.should respond_to(:from_fos_time)
  end

  it "Time and DateTime have proper class methods included from TimeFunctions" do
    Time.new.should respond_to(:as_minutes)
    DateTime.new.should respond_to(:as_minutes)
  end

  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 == DateTime.new(1899,12,31,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

31 entries across 31 versions & 1 rubygems

Version Path
fossil-0.3.26 spec/sequel/fos_dates_spec.rb
fossil-0.3.25 spec/sequel/fos_dates_spec.rb
fossil-0.3.24 spec/sequel/fos_dates_spec.rb
fossil-0.3.23 spec/sequel/fos_dates_spec.rb
fossil-0.3.22 spec/sequel/fos_dates_spec.rb
fossil-0.3.21 spec/sequel/fos_dates_spec.rb
fossil-0.3.20 spec/sequel/fos_dates_spec.rb
fossil-0.3.19 spec/sequel/fos_dates_spec.rb
fossil-0.3.18 spec/sequel/fos_dates_spec.rb
fossil-0.3.17 spec/sequel/fos_dates_spec.rb
fossil-0.3.16 spec/sequel/fos_dates_spec.rb
fossil-0.3.15 spec/sequel/fos_dates_spec.rb
fossil-0.3.14 spec/sequel/fos_dates_spec.rb
fossil-0.3.13 spec/sequel/fos_dates_spec.rb
fossil-0.3.12 spec/sequel/fos_dates_spec.rb
fossil-0.3.11 spec/sequel/fos_dates_spec.rb
fossil-0.3.10 spec/sequel/fos_dates_spec.rb
fossil-0.3.9 spec/sequel/fos_dates_spec.rb
fossil-0.3.8 spec/sequel/fos_dates_spec.rb
fossil-0.3.7 spec/sequel/fos_dates_spec.rb