summaryrefslogtreecommitdiff
path: root/vendor/github.com/stretchr/testify/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/stretchr/testify/README.md')
-rw-r--r--vendor/github.com/stretchr/testify/README.md56
1 files changed, 32 insertions, 24 deletions
diff --git a/vendor/github.com/stretchr/testify/README.md b/vendor/github.com/stretchr/testify/README.md
index e57b1811f..11951d4a5 100644
--- a/vendor/github.com/stretchr/testify/README.md
+++ b/vendor/github.com/stretchr/testify/README.md
@@ -9,7 +9,6 @@ Features include:
* [Easy assertions](#assert-package)
* [Mocking](#mock-package)
- * [HTTP response trapping](#http-package)
* [Testing suite interfaces and functions](#suite-package)
Get started:
@@ -106,14 +105,6 @@ The `require` package provides same global functions as the `assert` package, bu
See [t.FailNow](http://golang.org/pkg/testing/#T.FailNow) for details.
-
-[`http`](http://godoc.org/github.com/stretchr/testify/http "API documentation") package
----------------------------------------------------------------------------------------
-
-The `http` package contains test objects useful for testing code that relies on the `net/http` package. Check out the [(deprecated) API documentation for the `http` package](http://godoc.org/github.com/stretchr/testify/http).
-
-We recommend you use [httptest](http://golang.org/pkg/net/http/httptest) instead.
-
[`mock`](http://godoc.org/github.com/stretchr/testify/mock "API documentation") package
----------------------------------------------------------------------------------------
@@ -173,6 +164,29 @@ func TestSomething(t *testing.T) {
// assert that the expectations were met
testObj.AssertExpectations(t)
+
+}
+
+// TestSomethingElse is a second example of how to use our test object to
+// make assertions about some target code we are testing.
+// This time using a placeholder. Placeholders might be used when the
+// data being passed in is normally dynamically generated and cannot be
+// predicted beforehand (eg. containing hashes that are time sensitive)
+func TestSomethingElse(t *testing.T) {
+
+ // create an instance of our test object
+ testObj := new(MyMockedObject)
+
+ // setup expectations with a placeholder in the argument list
+ testObj.On("DoSomething", mock.Anything).Return(true, nil)
+
+ // call the code we are testing
+ targetFuncThatDoesSomethingWithObj(testObj)
+
+ // assert that the expectations were met
+ testObj.AssertExpectations(t)
+
+
}
```
@@ -268,14 +282,15 @@ Installation
To install Testify, use `go get`:
- * Latest version: go get github.com/stretchr/testify
- * Specific version: go get gopkg.in/stretchr/testify.v1
+ go get github.com/stretchr/testify
This will then make the following packages available to you:
github.com/stretchr/testify/assert
+ github.com/stretchr/testify/require
github.com/stretchr/testify/mock
- github.com/stretchr/testify/http
+ github.com/stretchr/testify/suite
+ github.com/stretchr/testify/http (deprecated)
Import the `testify/assert` package into your code using this template:
@@ -303,10 +318,10 @@ To update Testify to the latest version, use `go get -u github.com/stretchr/test
------
-Version History
-===============
+Supported go versions
+==================
- * 1.0 - New package versioning strategy adopted.
+We support the three major Go versions, which are 1.9, 1.10, and 1.11 at the moment.
------
@@ -319,14 +334,7 @@ When submitting an issue, we ask that you please include a complete test functio
------
-Licence
+License
=======
-Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell
-
-Please consider promoting this project if you find it useful.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+This project is licensed under the terms of the MIT license.