github.com/getgauge/gauge@v1.6.9/projectInit/init_test.go (about)

     1  /*----------------------------------------------------------------
     2   *  Copyright (c) ThoughtWorks, Inc.
     3   *  Licensed under the Apache License, Version 2.0
     4   *  See LICENSE in the project root for license information.
     5   *----------------------------------------------------------------*/
     6  
     7  package projectInit
     8  
     9  import (
    10  	"path/filepath"
    11  	"testing"
    12  
    13  	"github.com/getgauge/gauge/config"
    14  	. "gopkg.in/check.v1"
    15  )
    16  
    17  func Test(t *testing.T) { TestingT(t) }
    18  
    19  type MySuite struct{}
    20  
    21  var _ = Suite(&MySuite{})
    22  
    23  func (s *MySuite) TestIfGaugeProjectGivenEmptyDir(c *C) {
    24  	path, _ := filepath.Abs("_testdata")
    25  	config.ProjectRoot = path
    26  	c.Assert(isGaugeProject(), Equals, false)
    27  }
    28  
    29  func (s *MySuite) TestIfGaugeProject(c *C) {
    30  	path, _ := filepath.Abs(filepath.Join("_testdata", "gaugeProject"))
    31  	config.ProjectRoot = path
    32  	c.Assert(isGaugeProject(), Equals, true)
    33  }
    34  
    35  func (s *MySuite) TestIfGaugeProjectGivenDirWithNonGaugeManifest(c *C) {
    36  	path, _ := filepath.Abs(filepath.Join("_testdata", "foo"))
    37  	config.ProjectRoot = path
    38  	c.Assert(isGaugeProject(), Equals, false)
    39  }