From 3e33cbfbd48ab2ccada3893bcb56ab89186fbe94 Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Tue, 16 Oct 2012 21:25:58 +0100 Subject: [PATCH] enhanced readme --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ffcf7c..b02c5cc 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,21 @@ Assert package The `assert` package provides some helpful methods that allow you to write better test code in Go. -Some examples: +See it in action: func TestSomething(t *testing.T) { assert.Equal(t, 123, 123, "they should be equal") - assert.NotNil(t, object) + assert.Nil(t, object) - } \ No newline at end of file + if assert.NotNil(t, object) { + + assert.Equal(t, "Something", object.Value) + + } + + } + + * Every assert func takes the `testing.T` object as the first argument. This is how it writes the errors out through the normal `go test` capabilities. + * Every assert func returns a bool indicating whether the assertion was successful or not, this is useful for if you want to go on making further assertions under certain conditions. \ No newline at end of file