Skip to content

Including tests from stretchr/testify #12

@brunopiaui

Description

@brunopiaui

Hi,
Your extension is awesome!!
I would like to know if you can add the tests made from stretchr/testify lib?

package models

import (
	"testing"

	"github.com/cryo-management/api/common"
	"github.com/cryo-management/api/db"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/suite"

	_ "github.com/lib/pq"
)

// Define the suite, and absorb the built-in basic suite
// functionality from testify - including assertion methods.
type SchemaTestSuite struct {
	suite.Suite
}

// Make sure that VariableThatShouldStartAtFive is set to five
// before each test
func (suite *SchemaTestSuite) SetupTest() {
	_ = db.Connect()
}

// All methods that begin with "Test" are run as tests within a
// suite.
func (suite *SchemaTestSuite) TestLoad() {
	s := new(Schema)
	s.Load("SC016")
	assert.Equal(suite.T(), "SC016", s.Code, "invalid generated query")
}

// In order for 'go test' to run this suite, we need to create
// a normal test function and pass our suite to suite.Run
func TestSchemaTestSuite(t *testing.T) {
	suite.Run(t, new(SchemaTestSuite))
}

Show only the TestSchemaTestSuite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions