Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gorethink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

var sess *Session
Expand Down
2 changes: 1 addition & 1 deletion query_aggregation_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestAggregationReduce(c *test.C) {
Expand Down
4 changes: 2 additions & 2 deletions query_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestControlExecNil(c *test.C) {
Expand All @@ -15,7 +15,7 @@ func (s *RethinkSuite) TestControlExecNil(c *test.C) {

err = res.One(&response)

c.Assert(err, test.IsNil)
c.Assert(err, test.Equals, ErrEmptyResult)
c.Assert(response, test.Equals, nil)
}

Expand Down
2 changes: 1 addition & 1 deletion query_db_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestDbCreate(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_join_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestJoinInnerJoin(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_manipulation_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestManipulationDocField(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_math_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestMathAdd(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gorethink
import (
"fmt"

test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestSelectGet(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_string_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestStringMatchSuccess(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gorethink
import (
"sync"

test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestTableCreate(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gorethink

import test "launchpad.net/gocheck"
import test "gopkg.in/check.v1"

func (s *RethinkSuite) TestQueryRun(c *test.C) {
var response string
Expand Down
2 changes: 1 addition & 1 deletion query_time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gorethink
import (
"time"

test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestTimeTime(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_transformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (o *OrderByOpts) toMap() map[string]interface{} {
// Sort the sequence by document values of the given key(s).
// To specify the index to use for ordering us a last argument in the following form:
//
// map[string]interface{}{"index": "index-name"}
// OrderByOpts{Index: "index-name"}
//
// OrderBy defaults to ascending ordering. To explicitly specify the ordering,
// wrap the attribute with either Asc or Desc.
Expand Down
2 changes: 1 addition & 1 deletion query_transformation_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestTransformationMapImplicit(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion query_write_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gorethink

import (
test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestWriteInsert(c *test.C) {
Expand Down
5 changes: 4 additions & 1 deletion results.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,12 @@ func (c *Cursor) All(result interface{}) error {
return c.Close()
}

// All retrieves a single document from the result set into the provided
// One retrieves a single document from the result set into the provided
// slice and closes the cursor.
func (c *Cursor) One(result interface{}) error {
if c.IsNil() {
return ErrEmptyResult
}
ok := c.Next(result)
if !ok {
err := c.Err()
Expand Down
5 changes: 3 additions & 2 deletions results_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gorethink

import test "launchpad.net/gocheck"
import test "gopkg.in/check.v1"

type object struct {
Id int64 `gorethink:"id,omitempty"`
Expand Down Expand Up @@ -163,7 +163,8 @@ func (s *RethinkSuite) TestEmptyResults(c *test.C) {
res, err = Db("test").Table("test").Get("missing value").Run(sess)
c.Assert(err, test.IsNil)
var response interface{}
res.One(&response)
err = res.One(&response)
c.Assert(err, test.Equals, ErrEmptyResult)
c.Assert(res.IsNil(), test.Equals, true)

res, err = Db("test").Table("test").Get("missing value").Run(sess)
Expand Down
2 changes: 1 addition & 1 deletion session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gorethink
import (
"os"

test "launchpad.net/gocheck"
test "gopkg.in/check.v1"
)

func (s *RethinkSuite) TestSessionConnect(c *test.C) {
Expand Down
2 changes: 1 addition & 1 deletion wercker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build:
code: |
cd $WERCKER_SOURCE_DIR
go version
go get ./... && go get -u launchpad.net/gocheck && go test -i
go get ./... && go get -u gopkg.in/check.v1 && go test -i

# Build the project
- script:
Expand Down