Add prefix and suffix assertions
I found myself wanting to make assertions about string and slice prefixes and suffixes so I thought these might make sense for others as well.
I modeled the new assertions off of the existing Contains assertion, but I am open to changing it if the maintainers have other preferences.
I also changed the code generation script a bit to try to make it pass reliably across all relevant Go versions. If these issues can be resolved some better way I'd be happy to revert my changes.
So I'm not really sure why, but I can't get the generate script to run locally...
$ ./.travis.gogenerate.sh
2018/07/09 15:24:06 assertions.go:19:2: could not import github.com/davecgh/go-spew/spew (can't find import: "github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew")
exit status 1
assert/assertions.go:23: running "go": exit status 1
2018/07/09 15:24:06 assertions.go:19:2: could not import github.com/davecgh/go-spew/spew (can't find import: "github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew")
exit status 1
require/forward_requirements.go:16: running "go": exit status 1
$ go version
go version go1.10 darwin/amd64
If I switch to using a source importer (importer.For("source", nil)) then it works on the newer versions, but fails on the older version (since that importer didn't exist). I see the same error on master as I do when running this branch with 1.10, for what it's worth.
@ernesto-jimenez I can't seem to get the code generation to work in all versions of Go, even on master, any thoughts?
+1 for this PR :)
It looks like https://github.com/stretchr/testify/pull/620 will fix the build.
Another +1 for this addition