Skip to content

Instantly share code, notes, and snippets.

@robertbasic
Last active October 31, 2017 09:28
Show Gist options
  • Save robertbasic/aab10103d8575064448e4a3345c308f1 to your computer and use it in GitHub Desktop.
Save robertbasic/aab10103d8575064448e4a3345c308f1 to your computer and use it in GitHub Desktop.
Easier mocking with Mockery

Easier mocking with Mockery

A slow suite of unit tests can prevent us from running it frequently. A complicated and complex dependency graph of our system under test can prevent us from writing tests in the first place.

One way to tackle these problems is to create test doubles with Mockery, a mock object framework, that will stand in for these dependencies and ensure a faster test suite.

This talk will give an overview of test doubles - fakes, stubs, mocks, and spies - and how to use Mockery to create them. We'll learn about handling method calls, matching arguments, mocking static instances and hard dependencies. All that regardless of the testing framework of your choice - Mockery is here to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment