Integer#second, minute, hour, day, week, month, year are public methods
This commit is contained in:
parent
aa050bf2db
commit
0977da9b9b
@ -229,8 +229,8 @@ def test_time_plus_duration_returns_same_time_datatype
|
||||
twz = ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone["Moscow"], Time.utc(2016, 4, 28, 00, 45))
|
||||
now = Time.now.utc
|
||||
%w( second minute hour day week month year ).each do |unit|
|
||||
assert_equal((now + 1.send(unit)).class, Time, "Time + 1.#{unit} must be Time")
|
||||
assert_equal((twz + 1.send(unit)).class, ActiveSupport::TimeWithZone, "TimeWithZone + 1.#{unit} must be TimeWithZone")
|
||||
assert_equal((now + 1.public_send(unit)).class, Time, "Time + 1.#{unit} must be Time")
|
||||
assert_equal((twz + 1.public_send(unit)).class, ActiveSupport::TimeWithZone, "TimeWithZone + 1.#{unit} must be TimeWithZone")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user