Skip to content

Commit

Permalink
fixed bad target test
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Chechel committed Mar 3, 2018
1 parent 6f98081 commit 2a09895
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func GetOptions(arguments []string, stdout, stderr io.Writer, exit exitFunc) Opt
errors = append(errors, fmt.Sprintf("failed to parse target URL: %v", err))
}

if targetURL.Scheme != "http" && targetURL.Scheme != "https" {
if targetURL != nil && targetURL.Scheme != "http" && targetURL.Scheme != "https" {
errors = append(errors, fmt.Sprintf("unsupported scheme: %q", targetURL.Scheme))
}

Expand Down
2 changes: 1 addition & 1 deletion options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestGetOptions(t *testing.T) {
name: "bad target",
args: func(t *testing.T) args {
return args{
arguments: []string{"-t", "!"},
arguments: []string{"-t", "::"},
stderr: ioutil.Discard,
exit: func(code int) {
if code != 2 {
Expand Down

0 comments on commit 2a09895

Please sign in to comment.