"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "activesupport/test/core_ext/time_ext_test.rb" between
rails-6.1.3.2.tar.gz and rails-6.1.4.tar.gz

About: Ruby on Rails is a web application development framework (written in Ruby).

time_ext_test.rb  (rails-6.1.3.2):time_ext_test.rb  (rails-6.1.4)
skipping to change at line 924 skipping to change at line 924
# Only test this if the underlying Time.at raises a TypeError # Only test this if the underlying Time.at raises a TypeError
begin begin
Time.at_without_coercion(Time.now, 0) Time.at_without_coercion(Time.now, 0)
rescue TypeError rescue TypeError
assert_raise(TypeError) { assert_equal(Time.utc(2000, 1, 1, 0, 0, 0), Time .at(ActiveSupport::TimeWithZone.new(Time.utc(2000, 1, 1, 0, 0, 0), ActiveSupport ::TimeZone["UTC"]), 0)) } assert_raise(TypeError) { assert_equal(Time.utc(2000, 1, 1, 0, 0, 0), Time .at(ActiveSupport::TimeWithZone.new(Time.utc(2000, 1, 1, 0, 0, 0), ActiveSupport ::TimeZone["UTC"]), 0)) }
end end
end end
if RUBY_VERSION >= "2.6.0" if RUBY_VERSION >= "2.6.0"
def test_at_with_in_option def test_at_with_in_option
assert_equal Time.new(1970, 1, 1, 0, 42, 17, "-08:00"), Time.at(31337, in: -28800) assert_equal Time.new(1970, 1, 1, 0, 42, 17, "-08:00").to_s, Time.at(31337 , in: -28800).to_s
end end
end end
def test_at_with_time_with_zone_returns_local_time def test_at_with_time_with_zone_returns_local_time
with_env_tz "US/Eastern" do with_env_tz "US/Eastern" do
twz = ActiveSupport::TimeWithZone.new(Time.utc(2000, 1, 1, 0, 0, 0), Activ eSupport::TimeZone["London"]) twz = ActiveSupport::TimeWithZone.new(Time.utc(2000, 1, 1, 0, 0, 0), Activ eSupport::TimeZone["London"])
assert_equal Time.local(1999, 12, 31, 19, 0, 0), Time.at(twz) assert_equal Time.local(1999, 12, 31, 19, 0, 0), Time.at(twz)
assert_equal "EST", Time.at(twz).zone assert_equal "EST", Time.at(twz).zone
assert_equal(-18000, Time.at(twz).utc_offset) assert_equal(-18000, Time.at(twz).utc_offset)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)