Skip to content

Commit

Permalink
Merge pull request #68 from Harwayne/fix-tests
Browse files Browse the repository at this point in the history
Update the unit tests to compile.
  • Loading branch information
eldadru committed Jul 1, 2020
2 parents 2dcf896 + b3c9bd2 commit e03753c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRci
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
Expand Down
12 changes: 8 additions & 4 deletions pkg/cmd/sniff_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"ksniff/pkg/config"
"strings"

"github.com/spf13/cobra"
Expand All @@ -12,7 +13,8 @@ import (

func TestComplete_NotEnoughArguments(t *testing.T) {
// given
sniff := NewSniffOptions(genericclioptions.IOStreams{})
settings := config.NewKsniffSettings(genericclioptions.IOStreams{})
sniff := NewKsniff(settings)
cmd := &cobra.Command{}
var commands []string

Expand All @@ -26,7 +28,8 @@ func TestComplete_NotEnoughArguments(t *testing.T) {

func TestComplete_EmptyPodName(t *testing.T) {
// given
sniff := NewSniffOptions(genericclioptions.IOStreams{})
settings := config.NewKsniffSettings(genericclioptions.IOStreams{})
sniff := NewKsniff(settings)
cmd := &cobra.Command{}
var commands []string

Expand All @@ -40,7 +43,8 @@ func TestComplete_EmptyPodName(t *testing.T) {

func TestComplete_PodNameSpecified(t *testing.T) {
// given
sniff := NewSniffOptions(genericclioptions.IOStreams{})
settings := config.NewKsniffSettings(genericclioptions.IOStreams{})
sniff := NewKsniff(settings)
cmd := &cobra.Command{}
var commands []string

Expand All @@ -49,5 +53,5 @@ func TestComplete_PodNameSpecified(t *testing.T) {

// then
assert.Nil(t, err)
assert.Equal(t, "pod-name", sniff.UserSpecifiedPodName)
assert.Equal(t, "pod-name", settings.UserSpecifiedPodName)
}

0 comments on commit e03753c

Please sign in to comment.