Skip to content

Instantly share code, notes, and snippets.

@softwarebygabe
Last active August 22, 2019 04:00
Show Gist options
  • Save softwarebygabe/1c9772698b558ee6bb8e825707a33a7b to your computer and use it in GitHub Desktop.
Save softwarebygabe/1c9772698b558ee6bb8e825707a33a7b to your computer and use it in GitHub Desktop.
package foo_test
import (
"testing"
"interfaces/foo"
)
func TestController_Success(t *testing.T) {
err := foo.Controller()
if err != nil {
t.FailNow()
}
}
func TestController_Failure(t *testing.T) {
// we want this to error but we can't get it to
// because we can't easily stub the external.Client struct
err := foo.Controller()
if err == nil {
// this test will fail :(
t.FailNow()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment