Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ type SpyTime struct {
durationSlept time.Duration
}

func (s *SpyTime) Sleep(duration time.Duration) {
func (s *SpyTime) SetDurationSlept(duration time.Duration) {
s.durationSlept = duration
}
```
Expand All @@ -505,7 +505,7 @@ func TestConfigurableSleeper(t *testing.T) {
sleepTime := 5 * time.Second

spyTime := &SpyTime{}
sleeper := ConfigurableSleeper{sleepTime, spyTime.Sleep}
sleeper := ConfigurableSleeper{sleepTime, spyTime.SetDurationSlept}
sleeper.Sleep()

if spyTime.durationSlept != sleepTime {
Expand Down
4 changes: 2 additions & 2 deletions mocking/v5/countdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestConfigurableSleeper(t *testing.T) {
sleepTime := 5 * time.Second

spyTime := &SpyTime{}
sleeper := ConfigurableSleeper{sleepTime, spyTime.Sleep}
sleeper := ConfigurableSleeper{sleepTime, spyTime.SetDurationSlept}
sleeper.Sleep()

if spyTime.durationSlept != sleepTime {
Expand Down Expand Up @@ -76,6 +76,6 @@ type SpyTime struct {
durationSlept time.Duration
}

func (s *SpyTime) Sleep(duration time.Duration) {
func (s *SpyTime) SetDurationSlept(duration time.Duration) {
s.durationSlept = duration
}
4 changes: 2 additions & 2 deletions mocking/v6/countdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestConfigurableSleeper(t *testing.T) {
sleepTime := 5 * time.Second

spyTime := &SpyTime{}
sleeper := ConfigurableSleeper{sleepTime, spyTime.Sleep}
sleeper := ConfigurableSleeper{sleepTime, spyTime.SetDurationSlept}
sleeper.Sleep()

if spyTime.durationSlept != sleepTime {
Expand Down Expand Up @@ -76,6 +76,6 @@ type SpyTime struct {
durationSlept time.Duration
}

func (s *SpyTime) Sleep(duration time.Duration) {
func (s *SpyTime) SetDurationSlept(duration time.Duration) {
s.durationSlept = duration
}