Skip to content

Commit

Permalink
cleanup unused variables, unclear syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdrew authored and joshuacronemeyer committed Aug 10, 2023
1 parent 4cb5072 commit d445455
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions test/time_stack_item_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions test/timecop_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit d445455

Please sign in to comment.