Skip to content

Commit

Permalink
Merge pull request #20 from fastbill/fix-cache-mock
Browse files Browse the repository at this point in the history
Fix mock for cache TTL method
  • Loading branch information
perajovic authored Feb 28, 2020
2 parents 27ac336 + 692e813 commit 011c372
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cache/cachemock/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ func (m *Cache) SetInt(key string, value int64, expiration time.Duration) error
func (m *Cache) TTL(key string) (time.Duration, error) {
args := m.Called(key)

if args.Get(0) != nil {
return args.Get(0).(time.Duration), args.Error(1)
}

return 0, args.Error(1)
return args.Get(0).(time.Duration), args.Error(1)
}

// SetJSON is a mock implementation of cache.Cache#SetJSON.
Expand Down

0 comments on commit 011c372

Please sign in to comment.