diff --git a/driver.go b/driver.go index 928e487..4e8e6f7 100644 --- a/driver.go +++ b/driver.go @@ -48,3 +48,7 @@ func (p *pgxmockPool) Close() { func (p *pgxmockPool) Acquire(context.Context) (*pgxpool.Conn, error) { return nil, errors.New("pgpool.Acquire() method is not implemented") } + +func (p *pgxmockPool) Stat() *pgxpool.Stat { + return &pgxpool.Stat{} +} \ No newline at end of file diff --git a/driver_test.go b/driver_test.go index 489c9f0..419c9df 100644 --- a/driver_test.go +++ b/driver_test.go @@ -47,3 +47,14 @@ func TestAcquire(t *testing.T) { t.Error("expected error, but got nil") } } + +func TestPoolStat(t *testing.T) { + mock, err := NewPool() + if err != nil { + t.Errorf("expected no error, but got: %s", err) + } + s := mock.Stat() + if s == nil { + t.Error("expected stat object, but got nil") + } +} diff --git a/pgxmock.go b/pgxmock.go index 5cb3d51..caa7414 100644 --- a/pgxmock.go +++ b/pgxmock.go @@ -135,6 +135,7 @@ type PgxPoolIface interface { pgx.Tx Acquire(ctx context.Context) (*pgxpool.Conn, error) Close() + Stat() *pgxpool.Stat } type pgxmock struct {