Created
February 17, 2021 10:04
-
-
Save lockwooddev/4dc843035ec2d89a4af6c866196f4a34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type MockRobotsClient struct { | |
| iter int64 | |
| Mocks []RobotRules | |
| } | |
| func NewMockRobotsClient(mocks []RobotRules) Roboteer { | |
| return &MockRobotsClient{Mocks: mocks} | |
| } | |
| func (m *MockRobotsClient) FetchRobots(url string) (RobotRules, error) { | |
| mock := m.Mocks[m.iter] | |
| m.iter++ | |
| return mock, nil | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment