File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ type SpyTime struct {
493
493
durationSlept time.Duration
494
494
}
495
495
496
- func (s *SpyTime ) Sleep (duration time .Duration ) {
496
+ func (s *SpyTime ) SetDurationSlept (duration time .Duration ) {
497
497
s.durationSlept = duration
498
498
}
499
499
```
@@ -505,7 +505,7 @@ func TestConfigurableSleeper(t *testing.T) {
505
505
sleepTime := 5 * time.Second
506
506
507
507
spyTime := &SpyTime{}
508
- sleeper := ConfigurableSleeper{sleepTime, spyTime.Sleep }
508
+ sleeper := ConfigurableSleeper{sleepTime, spyTime.SetDurationSlept }
509
509
sleeper.Sleep ()
510
510
511
511
if spyTime.durationSlept != sleepTime {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ func TestConfigurableSleeper(t *testing.T) {
48
48
sleepTime := 5 * time .Second
49
49
50
50
spyTime := & SpyTime {}
51
- sleeper := ConfigurableSleeper {sleepTime , spyTime .Sleep }
51
+ sleeper := ConfigurableSleeper {sleepTime , spyTime .SetDurationSlept }
52
52
sleeper .Sleep ()
53
53
54
54
if spyTime .durationSlept != sleepTime {
@@ -76,6 +76,6 @@ type SpyTime struct {
76
76
durationSlept time.Duration
77
77
}
78
78
79
- func (s * SpyTime ) Sleep (duration time.Duration ) {
79
+ func (s * SpyTime ) SetDurationSlept (duration time.Duration ) {
80
80
s .durationSlept = duration
81
81
}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ func TestConfigurableSleeper(t *testing.T) {
48
48
sleepTime := 5 * time .Second
49
49
50
50
spyTime := & SpyTime {}
51
- sleeper := ConfigurableSleeper {sleepTime , spyTime .Sleep }
51
+ sleeper := ConfigurableSleeper {sleepTime , spyTime .SetDurationSlept }
52
52
sleeper .Sleep ()
53
53
54
54
if spyTime .durationSlept != sleepTime {
@@ -76,6 +76,6 @@ type SpyTime struct {
76
76
durationSlept time.Duration
77
77
}
78
78
79
- func (s * SpyTime ) Sleep (duration time.Duration ) {
79
+ func (s * SpyTime ) SetDurationSlept (duration time.Duration ) {
80
80
s .durationSlept = duration
81
81
}
You can’t perform that action at this time.
0 commit comments