Files
dolt/samples/js/counter/integration_test.go
T
Erik Arvidsson 984fef226f Change dataset CommitWithParents to Commit with options (#2095)
The new API is `ds.Commit(value, CommitOptions{Parents: p})`

Related to #2012
2016-07-19 14:30:59 -07:00

46 lines
965 B
Go

// Copyright 2016 Attic Labs, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
package counter
import (
"testing"
"github.com/attic-labs/noms/go/dataset"
"github.com/attic-labs/noms/go/types"
"github.com/attic-labs/noms/go/util/integrationtest"
)
const dsName = "test-counter"
func TestIntegration(t *testing.T) {
integrationtest.Run(t, &testSuite{})
}
type testSuite struct {
integrationtest.IntegrationSuite
}
func (s *testSuite) Setup() {
db := s.Database()
defer db.Close()
ds := dataset.NewDataset(db, dsName)
_, err := ds.CommitValue(types.Number(42))
s.NoError(err)
}
func (s *testSuite) Teardown() {
s.Equal("43\n", s.NodeOutput())
db := s.Database()
defer db.Close()
ds := dataset.NewDataset(db, dsName)
s.True(ds.HeadValue().Equals(types.Number(43)))
}
func (s *testSuite) NodeArgs() []string {
spec := s.ValueSpecString(dsName)
return []string{spec}
}