This file is indexed.

/usr/share/gocode/src/github.com/smartystreets/goconvey/web/server/system/fake_shell_test.go is in golang-github-smartystreets-goconvey-dev 1.5.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package system

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestFakeShell(t *testing.T) {
	var shell *FakeShell
	var output string
	var err error

	Convey("Subject: FakeShell", t, func() {
		shell = NewFakeShell()

		Convey("When executing go test", func() {
			output, err = shell.GoTest("/hi")
			shell.GoTest("/bye")

			Convey("The output should be an echo of the input", func() {
				So(output, ShouldEqual, "/hi")
			})

			Convey("There should be no error", func() {
				So(err, ShouldBeNil)
			})

			Convey("The shell should remember the directory of execution", func() {
				So(shell.Executions(), ShouldResemble, []string{"/hi", "/bye"})
			})
		})

		Convey("When setting an environment variable", func() {
			err := shell.Setenv("variable", "42")

			Convey("The value should persist", func() {
				So(shell.Getenv("variable"), ShouldEqual, "42")
			})

			Convey("The error should be nil", func() {
				So(err, ShouldBeNil)
			})
		})
	})
}