Skip to content

Commit 2791e11

Browse files
committed
bring in porcelain Run() tests
Forgot to bring over the content of `github.com/jaypipes/gdt/run_test.go` which tests that Suite and Scenario returned from `gdt.From()` can be properly `Run()`. Signed-off-by: Jay Pipes <[email protected]>
1 parent e5884d3 commit 2791e11

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

porcelain_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package gdt_test
66

77
import (
8+
"context"
89
"os"
910
"path/filepath"
1011
"testing"
@@ -108,3 +109,30 @@ tests:
108109
assert.Equal("", sc.Path)
109110
assert.Len(sc.Tests, 1)
110111
}
112+
113+
func TestRunExecSuite(t *testing.T) {
114+
assert := assert.New(t)
115+
116+
fp := filepath.Join("suite", "testdata", "exec")
117+
s, err := gdt.From(fp)
118+
assert.Nil(err)
119+
assert.NotNil(s)
120+
121+
err = s.Run(context.TODO(), t)
122+
assert.Nil(err)
123+
assert.False(t.Failed())
124+
}
125+
126+
func TestRunExecScenario(t *testing.T) {
127+
assert := assert.New(t)
128+
require := require.New(t)
129+
130+
fp := filepath.Join("suite", "testdata", "exec", "ls.yaml")
131+
s, err := gdt.From(fp)
132+
require.Nil(err)
133+
require.NotNil(s)
134+
135+
err = s.Run(context.TODO(), t)
136+
assert.Nil(err)
137+
assert.False(t.Failed())
138+
}

0 commit comments

Comments
 (0)