yarpc / yarpc-go

A message passing platform for Go
MIT License
405 stars 103 forks source link

Crossdock: make assert & fails api feel more idiomatic #208

Closed HelloGrayson closed 8 years ago

HelloGrayson commented 8 years ago

Currently we have to get a assert and fails object at the top of every test:

func Run(t crossdock.T) {
    assert := crossdock.Assert(t)
    fatals := crossdock.Fatals(t)

    // ...

    assert.Equal(100, 100)
    fatals.NoError(err)
}

Instead, we should aim to feel a bit more like other testing apis:

import (
    "github.com/yarpc/yarpc-go/crossdock-go/assert"
    "github.com/yarpc/yarpc-go/crossdock-go/fatals"
)

func Run(t crossdock.T) {
    assert.Equal(t, 100, 100)
    fatals.NoError(t, err)
}
HelloGrayson commented 8 years ago

@abhinav think its doable? Even if we take on a good deal of clutter in crossdock-go, I think its worth it to give people a consistent experience.

HelloGrayson commented 8 years ago

Moved to https://github.com/crossdock/crossdock-go/issues/3