Giter VIP home page Giter VIP logo

Comments (5)

marcosnils avatar marcosnils commented on August 23, 2024

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.

marcosnils avatar marcosnils commented on August 23, 2024

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.

mattetti avatar mattetti commented on August 23, 2024

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.

marcosnils avatar marcosnils commented on August 23, 2024

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.

mattetti avatar mattetti commented on August 23, 2024

👍 thanks

from goblin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.