FAQ
Hey all,

I've been meaning to announce this to the golang-nuts list for a while :)

Ginkgo is a mature feature-rich BDD-style testing framework for Go with a
laundry list of features:
https://github.com/onsi/ginkgo

Gomega is Ginkgo's preferred matcher/assertion library:
https://github.com/onsi/gomega

Here's a blog post announcement from a couple of months ago:
http://pivotallabs.com/announcing-ginkgo-and-gomega-bdd-style-testing-for-golang/

And there's plenty of documentation of both the /doc and /pkg variety:
http://onsi.github.io/ginkgo/
http://onsi.github.io/gomega/
...and godoc of course!

Enjoy!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Chris Maddox at Dec 6, 2013 at 11:36 pm
    Hey Onsi,

    Firstly, thank you for you hard work on these projects. I've been using
    both for about a week and they are a great addition.

    To mimic stubs/mocks for external systems, would you suggest using
    dependency injection? Specifically, when building an API client, what's the
    best way to test the calls without hitting the service itself?

    Thanks!
    Chris
    On Friday, December 6, 2013 6:23:44 AM UTC-8, Onsi Fakhouri wrote:

    Hey all,

    I've been meaning to announce this to the golang-nuts list for a while :)

    Ginkgo is a mature feature-rich BDD-style testing framework for Go with a
    laundry list of features:
    https://github.com/onsi/ginkgo

    Gomega is Ginkgo's preferred matcher/assertion library:
    https://github.com/onsi/gomega

    Here's a blog post announcement from a couple of months ago:

    http://pivotallabs.com/announcing-ginkgo-and-gomega-bdd-style-testing-for-golang/

    And there's plenty of documentation of both the /doc and /pkg variety:
    http://onsi.github.io/ginkgo/
    http://onsi.github.io/gomega/
    ...and godoc of course!

    Enjoy!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Onsi Fakhouri at Dec 7, 2013 at 4:51 am
    Thanks Chris!

    Regarding stubs/mocks: exactly -- I use interfaces for all my dependencies
    and then inject fakes under test. For faking out (http) API end points you
    can look into using the built-in http://golang.org/pkg/net/http/httptest/.
      This allows you (basically) to fake out the server end of things. I
    actually think there's a better approach to this, though, but it requires a
    bit more infrastructure and some non-trivial fakes. Rather than fake out
    the server I find it much more flexible to fake out the client. This
    allows me to grab a network request under test *after* the code has made
    the request and then make assertions on it and then exercise it under
    different conditions (what happens when it 200s? what happens when it
    404s? etc...) There's a (very complicated... sorry!) example of this
    here: https://github.com/cloudfoundry/hm9000/blob/master/desiredstatefetcher/desired_state_fetcher_test.go

    Best,

    Onsi


    On Friday, December 6, 2013 3:36:19 PM UTC-8, Chris Maddox wrote:

    Hey Onsi,

    Firstly, thank you for you hard work on these projects. I've been using
    both for about a week and they are a great addition.

    To mimic stubs/mocks for external systems, would you suggest using
    dependency injection? Specifically, when building an API client, what's the
    best way to test the calls without hitting the service itself?

    Thanks!
    Chris
    On Friday, December 6, 2013 6:23:44 AM UTC-8, Onsi Fakhouri wrote:

    Hey all,

    I've been meaning to announce this to the golang-nuts list for a while :)

    Ginkgo is a mature feature-rich BDD-style testing framework for Go with a
    laundry list of features:
    https://github.com/onsi/ginkgo

    Gomega is Ginkgo's preferred matcher/assertion library:
    https://github.com/onsi/gomega

    Here's a blog post announcement from a couple of months ago:

    http://pivotallabs.com/announcing-ginkgo-and-gomega-bdd-style-testing-for-golang/

    And there's plenty of documentation of both the /doc and /pkg variety:
    http://onsi.github.io/ginkgo/
    http://onsi.github.io/gomega/
    ...and godoc of course!

    Enjoy!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • AllenDang at Dec 7, 2013 at 2:00 am
    Thanks! It looks great! Can't wait to write some tests. :)
    On Friday, December 6, 2013 10:23:44 PM UTC+8, Onsi Fakhouri wrote:

    Hey all,

    I've been meaning to announce this to the golang-nuts list for a while :)

    Ginkgo is a mature feature-rich BDD-style testing framework for Go with a
    laundry list of features:
    https://github.com/onsi/ginkgo

    Gomega is Ginkgo's preferred matcher/assertion library:
    https://github.com/onsi/gomega

    Here's a blog post announcement from a couple of months ago:

    http://pivotallabs.com/announcing-ginkgo-and-gomega-bdd-style-testing-for-golang/

    And there's plenty of documentation of both the /doc and /pkg variety:
    http://onsi.github.io/ginkgo/
    http://onsi.github.io/gomega/
    ...and godoc of course!

    Enjoy!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 6, '13 at 9:35p
activeDec 7, '13 at 4:51a
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase