Skip to content

Commit 5c9baa9

Browse files
committed
Date::VERSION is not defined for Ruby 3.0.2, date (default: 3.1.0)
1 parent 05888d2 commit 5c9baa9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spec/ruby/library/datetime/to_time_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
time.sec.should == 59
1919
end
2020

21-
version_is(Date::VERSION, '3.2.3') do
21+
date_version = defined?(Date::VERSION) ? Date::VERSION : '0.0.0'
22+
version_is(date_version, '3.2.3') do
2223
it "returns a Time representing the same instant before Gregorian" do
2324
datetime = DateTime.civil(1582, 10, 4, 23, 58, 59)
2425
time = datetime.to_time.utc

spec/ruby/library/time/to_datetime_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
datetime.sec.should == 59
1414
end
1515

16-
version_is(Date::VERSION, '3.2.3') do
16+
date_version = defined?(Date::VERSION) ? Date::VERSION : '0.0.0'
17+
version_is(date_version, '3.2.3') do
1718
it "returns a DateTime representing the same instant before Gregorian" do
1819
time = Time.utc(1582, 10, 14, 23, 58, 59)
1920
datetime = time.to_datetime

0 commit comments

Comments
 (0)