Skip to content

Commit

Permalink
Merge pull request #39 from benhoyt/remove-sqlmock-dependency
Browse files Browse the repository at this point in the history
Remove sqlmock dependency
  • Loading branch information
lucasb-eyer committed Nov 2, 2019
2 parents c27817f + cec65bb commit fadcb7c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: go
install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/DATA-DOG/go-sqlmock
- go get github.com/mattn/goveralls
script:
- go test -v -covermode=count -coverprofile=coverage.out
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module github.com/lucasb-eyer/go-colorful

go 1.12

require github.com/DATA-DOG/go-sqlmock v1.3.3
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
28 changes: 0 additions & 28 deletions hexcolor_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package colorful

import (
"fmt"
"log"
"reflect"
"testing"

"github.com/DATA-DOG/go-sqlmock"
)

func TestHexColor(t *testing.T) {
Expand All @@ -32,27 +28,3 @@ func TestHexColor(t *testing.T) {
}
}
}

func Example_HexColor_Scan() {
db, mock, err := sqlmock.New()
if err != nil {
log.Fatal(err)
}
defer db.Close()

mock.ExpectQuery("SELECT '#ff0000' AS color;").
WillReturnRows(
sqlmock.NewRows([]string{"color"}).
AddRow("#ff0000"),
)

var hc HexColor
if err := db.QueryRow("SELECT '#ff0000' AS color;").Scan(&hc); err != nil {
log.Fatal(err)
}

fmt.Printf("hc = %+v\n", hc)

// Output:
// hc = {R:1 G:0 B:0}
}

0 comments on commit fadcb7c

Please sign in to comment.