Skip to content

Commit

Permalink
comment and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnb-devoted committed Aug 1, 2022
1 parent 5ecc032 commit 483d3cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions pgxmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ func (c *pgxmock) NewRows(columns []string) *Rows {
return r
}

// ConnInfo returns the connection info used for this connection
func (c *pgxmock) ConnInfo() *pgtype.ConnInfo {
ci := pgtype.ConnInfo{}
return &ci
Expand Down
10 changes: 10 additions & 0 deletions pgxmock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1198,3 +1198,13 @@ func TestCon(t *testing.T) {
}()
_ = mock.Conn()
}

func TestConnInfo(t *testing.T) {
mock, err := NewConn()
if err != nil {
t.Errorf("an error '%s' was not expected when opening a stub database connection", err)
}
defer mock.Close(context.Background())

_ = mock.ConnInfo()
}

0 comments on commit 483d3cc

Please sign in to comment.