Sha256: 982017e728b173c17670e908320dd8c6a916ae7ae43829c42f6d5d1844275a36

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 KB

Contents

require(File.join(File.dirname(__FILE__), '..', 'compat_spec_helper'))

describe ThirdBase::CompatInstanceMethods do
  before do
    @d = Date.civil(2008, 10, 11)
  end

  it "#ajd should be the same as jd" do
    @d.ajd.should == @d.jd
  end

  it "#amjd should be the astronomical modified julian date" do
    @d.amjd.should == 54750
  end

  it "#gregorian, #england, #julian, #italy, #new_start, and #newsg should be the same as self" do
    @d.gregorian.should == @d
    @d.england.should == @d
    @d.julian.should == @d
    @d.italy.should == @d
    @d.new_start.should == @d
    @d.newsg.should == @d
    @d.new_start(1).should == @d
    @d.newsg(1).should == @d
  end

  it "#gregorian? and ns? should be true" do
    @d.gregorian?.should == true
    @d.ns?.should == true
  end

  it "#julian? and os? should be false" do
    @d.julian?.should == false
    @d.os?.should == false
  end

  it "#ld should be the days since italian calendar reform day" do
    @d.ld.should == 155591
  end

  it "#mday should be the same as day" do
    @d.mday.should == @d.day
  end

  it "#mjd should be the modified julian date" do
    @d.mjd.should == 54750
  end

  it "#start and #sg should equal 0" do
    @d.start.should == 0
    @d.sg.should == 0
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
third_base-1.3.0 spec/compat/compat_instance_methods_spec.rb
third_base-1.2.0 spec/compat/compat_instance_methods_spec.rb
third_base-1.1.1 spec/compat/compat_instance_methods_spec.rb
third_base-1.1.0 spec/compat/compat_instance_methods_spec.rb
third_base-1.0.0 spec/compat/compat_instance_methods_spec.rb
third_base-1.0.1 spec/compat/compat_instance_methods_spec.rb