1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/date/gregorian_spec.rb
2020-05-03 12:28:29 +02:00

16 lines
483 B
Ruby

require_relative '../../spec_helper'
require 'date'
describe "Date#gregorian?" do
it "marks a day before the calendar reform as Julian" do
Date.civil(1007, 2, 27).gregorian?.should be_false
Date.civil(1907, 2, 27, Date.civil(1930, 1, 1).jd).gregorian?.should be_false
end
it "marks a day after the calendar reform as Julian" do
Date.civil(2007, 2, 27).should.gregorian?
Date.civil(1607, 2, 27, Date.civil(1582, 1, 1).jd).gregorian?.should be_true
end
end