Sha256: 1282e17b05b3dd4ea904685eb9980be98f2c38a79befe5aa382cfefa9cb407a9

Contents?: true

Size: 1.65 KB

Versions: 2

Compression:

Stored size: 1.65 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe "Parsi::Date#ajd" do
  it "determines the Astronomical Julian day" do
    Parsi::Date.civil(1391, 8, 6).ajd.should == Rational(4912455, 2)
  end
end

describe "Parsi::Date#amjd" do
  it "determines the Astronomical Modified Julian day" do
    Parsi::Date.civil(1391, 8, 6).amjd.should == 56227
  end
end

describe "Parsi::Date#mjd" do
  it "determines the Modified Julian day" do
    Parsi::Date.civil(1391, 8, 6).mjd.should == 56227
  end
end

describe "Parsi::Date#ld" do
  it "determines the Modified Julian day" do
    Parsi::Date.civil(1391, 8, 6).ld.should == 157068
  end
end

describe "Parsi::Date#year" do
  it "determines the year" do
    Parsi::Date.civil(1391, 8, 6).year.should == 1391
  end
end

describe "Parsi::Date#yday" do
  it "determines the year" do
    Parsi::Date.civil(1391, 1, 17).yday.should == 17
    Parsi::Date.civil(1391, 8, 6).yday.should == 222
  end
end

describe "Parsi::Date#mon" do
  it "determines the month" do
    Parsi::Date.civil(1391, 1, 17).mon.should == 1
    Parsi::Date.civil(1391, 8, 6).mon.should == 8
  end
end

describe "Parsi::Date#mday" do
  it "determines the day of the month" do
    Parsi::Date.civil(1391, 1, 17).mday.should == 17
    Parsi::Date.civil(1391, 10, 28).mday.should == 28
  end
end

describe "Parsi::Date#wday" do
  it "determines the week day" do
    Parsi::Date.civil(1391, 1, 17).wday.should == 5
    Parsi::Date.civil(1391, 8, 6).wday.should == 0
  end
end

describe "Parsi::Date#cwday" do
  it "determines the commercial week day" do
    Parsi::Date.civil(1391, 1, 17).cwday.should == 6
    Parsi::Date.civil(1391, 8, 6).cwday.should == 1
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parsi-date-0.1 spec/parsi-date/accessor_spec.rb
parsi-date-0.1.pre spec/parsi-date/accessor_spec.rb