Documentation ¶
Overview ¶
Package clocktest provides a testable clock implementation
Index ¶
- type Mock
- func (m *Mock) NewTicker(d time.Duration) clock.Ticker
- func (m *Mock) NewTimer(d time.Duration) clock.Timer
- func (m *Mock) Now() time.Time
- func (m *Mock) OnNewTicker(d time.Duration, t clock.Ticker) *mock.Call
- func (m *Mock) OnNewTimer(d time.Duration, t clock.Timer) *mock.Call
- func (m *Mock) OnNow(v time.Time) *mock.Call
- func (m *Mock) OnSleep(d time.Duration) *mock.Call
- func (m *Mock) Sleep(d time.Duration)
- type MockTicker
- type MockTimer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
Mock is a stretchr mock for a clock. In addition to implementing clock.Interface and supplying mock behavior, other methods that make mocking a bit easier are supplied.
type MockTicker ¶
func (*MockTicker) C ¶
func (m *MockTicker) C() <-chan time.Time
func (*MockTicker) OnStop ¶
func (m *MockTicker) OnStop() *mock.Call
func (*MockTicker) Stop ¶
func (m *MockTicker) Stop()
Click to show internal directories.
Click to hide internal directories.