Comments (5)
Hey @mattetti Goblin is a self tested framework, that means that all Goblin tests use Goblin. That being said, it's normal that whenever you run go test
you'll see a couple of failures as we need to test failures as well 😄.
If you want to write and execute a new test, you can just add your test to the goblin_test.go file and then run that only test by calling go test -test.run {your test name}.
ie: go test -test.run TestAddNumbersSucceed
. This will only run that test only.
Anyways, the way to find out if the tests are running ok is by looking at the last line of the test run. If it says something like ok _/home/mlilljedahl/Projects/goblin 0.598s
then everything's file. On the other hand, if a test failed you'll see something like FAIL _/home/mlilljedahl/Projects/goblin 0.553s
.
If you have more questions, please ask.
Marcos.
from goblin.
BTW, what are you looking forward to incorporate to Goblin?. If it's something that our users will find useful we can work to implement it together.
from goblin.
Thanks Marcos, I'm looking at adding some basic assertions to Assertion
. I don't think that having to use Gomega for a few basic assertions makes sense. I was thinking about adding BeTrue()
and BeFalse()
and/or potential Check()
:
g.Assert(x.IsEnabled).BeTrue()
g.Assert(x.IsAdmin).BeFalse()
g.Assert(err == nil).BeTrue()
g.Assert(x.IsEnabled).Check()
g.Assert(!x.IsAdmin).Check()
g.Assert(err == nil).Check()
Check()
would simply verify that the assertion source is true
which is often the way assert
is used in other languages/test frameworks.
Finally, I was wondering if you'd consider adding an alias for Equal
that was shorter to type, maybe Eq
or Eql
?
from goblin.
Matt,
I do agree that we should expand our assertion library. We didn't put a lot of effort on doing that as we think Gomega is ok and saved us a lot of time when releasing Goblin.
Anyways i've added the BeTrue and BeFalse assertions you mentioned as I think those are very useful. You can take a look at the change in #32
As soon as some other contributor ( @xetorthio ) approves the change, you'll be able to use it in your Goblin tests.
As a bonus, I've also added the Eql shorthand as well.
from goblin.
👍 thanks
from goblin.
Related Issues (20)
- Can't range over data set inside Describe block HOT 2
- Add support for mocking library HOT 6
- Dep ensures invalid version. HOT 1
- 0 not equal 0x0 HOT 1
- Regexp test selector does not seem to work. HOT 4
- basic error handle for incorrect use of the library HOT 2
- Table driven tests will test only last item HOT 4
- Allow multiple `errors` from failed test HOT 2
- Assertion redeclared during import w/ Gomega HOT 2
- Proposal: Please start using Semantic Versioning HOT 3
- Dependent Tests, skip some subset of tests if the parent test fails HOT 5
- IsNil (mis)behavior on pointers HOT 1
- Concurrency race when running in parallel
- Error output from testify doesn't use goblin theme HOT 1
- Test hooks should not execute if all tests are skipped HOT 3
- Request for describe comments to be matched with -goblin.run regexp HOT 4
- NotEqual assertions HOT 2
- How to run each test in parallel in test suite? HOT 5
- Is it expected, that Goblin doesn't output anything if all tests pass? HOT 2
- Documentation for Before and After HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goblin.