Skip to content

Commit b52ef39

Browse files
committed
Add CHANGELOG and tests
1 parent 4ce699e commit b52ef39

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# v2.3.0
22

3+
- Preserve test execution order alphabetical order
34
- Add property `skip`, adds the ability to skip test cases
45

56
# v2.2.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Build Status](https://travis-ci.org/commander-cli/commander.svg?branch=master)](https://travis-ci.org/commander-cli/commander)
22
[![GoDoc](https://godoc.org/github.com/commander-cli/commander?status.svg)](https://godoc.org/github.com/commander-cli/commander)
3-
[![Go Report Card](https://goreportcard.com/badge/github.com/commander-cli/commander)](https://goreportcard.com/report/github.com/SimonBaeumer/commander)
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/commander-cli/commander)](https://goreportcard.com/report/github.com/commander-cli/commander)
44
[![Maintainability](https://api.codeclimate.com/v1/badges/cc848165784e0f809a51/maintainability)](https://codeclimate.com/github/commander-cli/commander/maintainability)
55
[![Test Coverage](https://api.codeclimate.com/v1/badges/cc848165784e0f809a51/test_coverage)](https://codeclimate.com/github/commander-cli/commander/test_coverage)
66
[![Github All Releases](https://img.shields.io/github/downloads/commander-cli/commander/total.svg)](https://github.com/commander-cli/commander/releases)

pkg/runtime/runtime_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ func TestRuntime_WithRetries(t *testing.T) {
4747
assert.Equal(t, 1, counter)
4848
}
4949

50+
func Test_AlphabeticalOrder(t *testing.T) {
51+
tests := []TestCase{
52+
{Title: "bbb", Command: CommandUnderTest{Cmd: "exit 0;"}},
53+
{Title: "aaa"},
54+
{Title: "111"},
55+
{Title: "_"},
56+
}
57+
58+
got := []string{}
59+
runtime := NewRuntime(&EventHandler{TestFinished: func(r TestResult) {
60+
got = append(got, r.TestCase.Title)
61+
}})
62+
63+
runtime.Start(tests)
64+
65+
assert.Equal(t, "111", got[0])
66+
assert.Equal(t, "_", got[1])
67+
assert.Equal(t, "aaa", got[2])
68+
assert.Equal(t, "bbb", got[3])
69+
}
70+
5071
func Test_RuntimeWithRetriesAndInterval(t *testing.T) {
5172
s := getExampleTestCases()
5273
s[0].Command.Retries = 3

0 commit comments

Comments
 (0)