Skip to content

Commit

Permalink
use require
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Oct 30, 2023
1 parent 20bc6f8 commit 05efcb3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -150,7 +149,7 @@ func Test_runVersionCmd(t *testing.T) {
})

require.NoError(t, cmd.Execute())
assert.Equal(t, "\n", mockOut.String())
require.Equal(t, "\n", mockOut.String())
mockOut.Reset()

cmd.SetArgs([]string{
Expand All @@ -167,13 +166,13 @@ func Test_runVersionCmd(t *testing.T) {
require.NoError(t, cmd.Execute())

extraInfoFromContext := ctx.Value(version.ContextKey{})
assert.NotNil(t, extraInfoFromContext)
require.NotNil(t, extraInfoFromContext)

castedExtraInfo, ok := extraInfoFromContext.(*version.ExtraInfo)
assert.True(t, ok)
require.True(t, ok)

key1Value := (*castedExtraInfo)["key1"]
assert.Equal(t, "value1", key1Value)
require.Equal(t, "value1", key1Value)

assert.Equal(t, string(stringInfo)+"\n", mockOut.String())
require.Equal(t, string(stringInfo)+"\n", mockOut.String())
}

0 comments on commit 05efcb3

Please sign in to comment.