File tree 3 files changed +10
-9
lines changed 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ def test_add_across_midnight
132
132
assert '00:01' , Clock . at ( 23 , 59 ) + 2
133
133
end
134
134
135
- def test_add_more_than_one_day__1500_min_is_equal_to_25_hrs_
135
+ def test_add_more_than_one_day__1500_min_is_equal_to_25_hrs
136
136
skip
137
137
assert '06:32' , Clock . at ( 5 , 32 ) + 1500
138
138
end
@@ -172,7 +172,7 @@ def test_subtract_more_than_two_hours_with_borrow
172
172
assert '03:35' , Clock . at ( 6 , 15 ) + -160
173
173
end
174
174
175
- def test_subtract_more_than_one_day__1500_min_is_equal_to_25_hrs_
175
+ def test_subtract_more_than_one_day__1500_min_is_equal_to_25_hrs
176
176
skip
177
177
assert '04:32' , Clock . at ( 5 , 32 ) + -1500
178
178
end
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ def self.at(*args)
5
5
Clock . new ( *args )
6
6
end
7
7
8
- def initialize ( hours = 0 , minutes = 0 )
8
+ def initialize ( hours = 0 , minutes = 0 )
9
9
@internal = hours * 60 + minutes
10
10
end
11
11
12
12
# rubocop:disable Style/OpMethod
13
- def +( hours = 0 , minutes )
13
+ def +( hours = 0 , minutes )
14
14
@internal += hours * 60 + minutes
15
15
self
16
16
end
Original file line number Diff line number Diff line change 1
1
class ClockCase < OpenStruct
2
2
def name
3
- 'test_%s' % description . gsub ( /[\( \) -]/ , '_' ) . gsub ( '=' , 'is_equal_to' )
3
+ 'test_%s' % description
4
+ . gsub ( /[() -]/ , '_' )
5
+ . gsub ( '=' , 'is_equal_to' )
6
+ . chomp ( '_' )
4
7
end
5
8
6
9
def test_body
7
- section == 'equal' &&
8
- compare_clocks || simple_test
10
+ section == 'equal' ? compare_clocks : simple_test
9
11
end
10
12
11
13
def compare_clocks
@@ -27,11 +29,10 @@ def add_to_clock
27
29
end
28
30
29
31
def skipped
30
- index > 0 && ' skip' || '# skip'
32
+ index . zero? ? '# skip' : ' skip'
31
33
end
32
34
end
33
35
34
- require 'pp'
35
36
ClockCases = proc do |data |
36
37
i = 0
37
38
json = JSON . parse ( data )
You can’t perform that action at this time.
0 commit comments