github.com/ndau/noms@v1.0.5/cmd/noms/noms_version_test.go (about)

     1  // Copyright 2016 Attic Labs, Inc. All rights reserved.
     2  // Licensed under the Apache License, version 2.0:
     3  // http://www.apache.org/licenses/LICENSE-2.0
     4  
     5  package main
     6  
     7  import (
     8  	"fmt"
     9  	"testing"
    10  
    11  	"github.com/ndau/noms/go/constants"
    12  	"github.com/ndau/noms/go/util/clienttest"
    13  	"github.com/stretchr/testify/suite"
    14  )
    15  
    16  func TestVersion(t *testing.T) {
    17  	suite.Run(t, &nomsVersionTestSuite{})
    18  }
    19  
    20  type nomsVersionTestSuite struct {
    21  	clienttest.ClientTestSuite
    22  }
    23  
    24  func (s *nomsVersionTestSuite) TestVersion() {
    25  	val, _ := s.MustRun(main, []string{"version"})
    26  	expectedVal := fmt.Sprintf("format version: %v\nbuilt from %v\n", constants.NomsVersion, constants.NomsGitSHA)
    27  	s.Equal(val, expectedVal)
    28  }