franela / goblin

Minimal and Beautiful Go testing framework
MIT License
883 stars 79 forks source link

Add testify support #55

Closed criloz closed 4 years ago

criloz commented 7 years ago

add support to https://github.com/stretchr/testify implements Errorf function

criloz commented 7 years ago

Example:

package foobar

import (
    "testing"
    . "github.com/franela/goblin"
    "github.com/stretchr/testify/assert"
)

func Test(t *testing.T) {
    g := Goblin(t)

    g.Describe("lala", func() {
        g.It("lslslslsls", func() {
            assert.Equal(g, 1, 10)
        })
    })
}
marcosnils commented 7 years ago

You're adding code that's not tested :S

criloz commented 7 years ago

@marcosnils can you tell where do you test your Fail function?, I try to look in the code but for my time schedule I could not find the test case, the Errorf function is almost the same, with the adition that allow format strings

marcosnils commented 7 years ago

@marcosnils can you tell where do you test your Fail function?, I try to look in the code but for my time schedule I could not find the test case, the Errorf function is almost the same, with the adition that allow format strings

I get it, but we can't add code without tests as someone will have to support this in the future. Here's how we test the Fail func:

https://github.com/franela/goblin/blob/b50404691661f34b0cea76cb2704fe5c0ccec90f/goblin_test.go#L160-L182

marcosnils commented 7 years ago

@criloz Fail and Failf have almost the same code. Can you please extract the common parts function so we don't have duplicated code?

criloz commented 7 years ago

@marcosnils sure, will work on that tomorrow. also update the readme with the testify support example

marcosnils commented 7 years ago

Amazing!. Thx a lot!. We're almost there :D

charleswhchan commented 5 years ago

Is this feature complete?

alexdreptu commented 4 years ago

What happened to this?

marcosnils commented 4 years ago

@alexdreptu seems like it never got completed and got abandoned.

artem-malko commented 4 years ago

@marcosnils as I can see, it is completed! No duplicated code) May be it is ok to merge it?)

artem-malko commented 4 years ago

I've checked it locally — works perfectly!)

schmurfy commented 4 years ago

I created #85 and fixed the 2016 issue with this pr

marcosnils commented 4 years ago

Closed by #85