From d445455148c04d81b1fac2788772753ad3064e9c Mon Sep 17 00:00:00 2001 From: Andrew Lazarus Date: Tue, 10 Oct 2017 17:06:48 -0700 Subject: [PATCH] cleanup unused variables, unclear syntax --- test/time_stack_item_test.rb | 6 +++--- test/timecop_test.rb | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/time_stack_item_test.rb b/test/time_stack_item_test.rb index 87422184..ed5ccf78 100644 --- a/test/time_stack_item_test.rb +++ b/test/time_stack_item_test.rb @@ -113,8 +113,8 @@ def test_new_with_individual_arguments end def test_rational_to_utc_offset - assert_equal -14400, a_time_stack_item.send(:rational_to_utc_offset, Rational(-1, 6)) - assert_equal -18000, a_time_stack_item.send(:rational_to_utc_offset, Rational(-5, 24)) + assert_equal(-14400, a_time_stack_item.send(:rational_to_utc_offset, Rational(-1, 6))) + assert_equal(-18000, a_time_stack_item.send(:rational_to_utc_offset, Rational(-5, 24))) assert_equal 0, a_time_stack_item.send(:rational_to_utc_offset, Rational(0, 1)) assert_equal 3600, a_time_stack_item.send(:rational_to_utc_offset, Rational(1, 24)) end @@ -222,7 +222,7 @@ def test_set_scaling_factor_for_scale def test_parse_only_string_with_active_support Time.expects(:parse).never - Timecop.freeze(2011, 01, 02, hour=0, minute=0, second=0) + Timecop.freeze(2011, 1, 2, 0, 0, 0) end def test_parse_date diff --git a/test/timecop_test.rb b/test/timecop_test.rb index 6badbcfd..e818e320 100644 --- a/test/timecop_test.rb +++ b/test/timecop_test.rb @@ -73,7 +73,6 @@ def test_travel_does_not_reduce_precision_of_datetime end def test_freeze_in_time_subclass_returns_mocked_subclass - t = Time.local(2008, 10, 10, 10, 10, 10) custom_timeklass = Class.new(Time) do def custom_format_method() strftime('%F') end end @@ -86,7 +85,6 @@ def custom_format_method() strftime('%F') end end def test_freeze_in_date_subclass_returns_mocked_subclass - t = Time.local(2008, 10, 10, 10, 10, 10) custom_dateklass = Class.new(Date) do def custom_format_method() strftime('%F') end end @@ -99,7 +97,6 @@ def custom_format_method() strftime('%F') end end def test_freeze_in_datetime_subclass_returns_mocked_subclass - t = Time.local(2008, 10, 10, 10, 10, 10) custom_datetimeklass = Class.new(DateTime) do def custom_format_method() strftime('%F') end end @@ -238,7 +235,6 @@ def test_exception_thrown_in_return_block_restores_previous_time def test_freeze_freezes_time t = Time.local(2008, 10, 10, 10, 10, 10) - now = Time.now Timecop.freeze(t) do #assert Time.now < now, "If we had failed to freeze, time would have proceeded, which is what appears to have happened." new_t, new_d, new_dt = Time.now, Date.today, DateTime.now @@ -252,7 +248,6 @@ def test_freeze_freezes_time def test_travel_keeps_time_moving t = Time.local(2008, 10, 10, 10, 10, 10) - now = Time.now Timecop.travel(t) do new_now = Time.now assert_times_effectively_equal(new_now, t, 1, "Looks like we failed to actually travel time")