-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring: simplify cli flags parsing (#74)
- Loading branch information
1 parent
345e86a
commit 30b669f
Showing
17 changed files
with
1,333 additions
and
996 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package command | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestArpCmdDstSubnetRequiredArg(t *testing.T) { | ||
cmd := newARPCmd().cmd | ||
err := cmd.Execute() | ||
require.Error(t, err) | ||
require.Equal(t, "requires one ip subnet argument", err.Error()) | ||
} | ||
|
||
func TestArpCmdInvalidDstSubnet(t *testing.T) { | ||
cmd := newARPCmd().cmd | ||
cmd.SetArgs([]string{"invalid_ip_address"}) | ||
err := cmd.Execute() | ||
require.Error(t, err) | ||
} |
Oops, something went wrong.