Go Mocket Versions Save

Go GORM & SQL mocking library

v1.0.7

5 years ago

No code was harm in the making of this release Only documentation update so that a few gotchas are clearer so everyone using it will not waste time.

v1.0.6

5 years ago

Linting issues were fixed and we now have an A+ on the Go Report Card

v1.0.5

5 years ago

Documentation was moved in the code (see DOCUMENTATION.md) And a failing test was fixed

v1.0.4

6 years ago

Now it's possible to pass different type values to the mock

v1.0.3

6 years ago

Support of any error type to be mocked as a result

WithError allows to set an error to any matched query.
For example


functionality_test.go
...
// in tests you write following
Mock.NewMock().WithQuery(`SELECT * FROM "campaign"`).WithError(sql.ErrNoRows) 
// rest part of test
...


functionality.go
...
// in order to be able to test following functionality in your code
if err:=DB.Find(&a, Campaign{UUID: uuid}).Error; err == sql.ErrNoRows {
 //some code here
}
...

v1.0.2

6 years ago

Support prepared statements with $ sign

v1.0.1

6 years ago
  • Added safe register functionality

v1.0.0

6 years ago