Skip to content

Commit

Permalink
Convert multi assertion test to single assertion
Browse files Browse the repository at this point in the history
Addresses feedback from 7b5aeda#r40989239
  • Loading branch information
atruskie committed Jul 29, 2020
1 parent e4c182b commit a96f568
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions spec/unit/modules/time_zone_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@
)
end

it 'can convert an offset in seconds into a readable timestamp' do
[[-7200, '-02:00'], [0, '+00:00'], [36_000, '+10:00']].each do |seconds, expected|
actual = TimeZoneHelper.offset_seconds_to_formatted(seconds)
expect(actual).to eq(expected)
context 'can convert an offset in seconds into a readable timestamp' do
CASES = [[-7200, '-02:00'], [0, '+00:00'], [15_300, '+04:15'], [36_000, '+10:00']]
CASES.each do |seconds, expected|
example "#{seconds}#{expected}" do
actual = TimeZoneHelper.offset_seconds_to_formatted(seconds)
expect(actual).to eq(expected)
end
end
end

Expand Down

0 comments on commit a96f568

Please sign in to comment.