Last active
August 22, 2019 04:00
-
-
Save softwarebygabe/1c9772698b558ee6bb8e825707a33a7b 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
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