Skip to content

Commit

Permalink
Date::VERSION is defined all supported versions
Browse files Browse the repository at this point in the history
It has been defined since date 3.0.3 bundled with ruby 2.7.0.
  • Loading branch information
nobu authored and eregon committed Jul 10, 2023
1 parent 60f4865 commit ac1c9c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions library/datetime/to_time_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
time.sec.should == 59
end

date_version = defined?(Date::VERSION) ? Date::VERSION : '0.0.0'
version_is(date_version, '3.2.3') do
version_is(Date::VERSION, '3.2.3') do #ruby_version_is "3.2" do
it "returns a Time representing the same instant before Gregorian" do
datetime = DateTime.civil(1582, 10, 4, 23, 58, 59)
time = datetime.to_time.utc
Expand Down
3 changes: 1 addition & 2 deletions library/time/to_datetime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
datetime.sec.should == 59
end

date_version = defined?(Date::VERSION) ? Date::VERSION : '0.0.0'
version_is(date_version, '3.2.3') do
version_is(Date::VERSION, '3.2.3') do #ruby_version_is '3.2' do
it "returns a DateTime representing the same instant before Gregorian" do
time = Time.utc(1582, 10, 14, 23, 58, 59)
datetime = time.to_datetime
Expand Down

0 comments on commit ac1c9c6

Please sign in to comment.