Skip to content

Commit

Permalink
Empty command (#14)
Browse files Browse the repository at this point in the history
* Fix empty command

* Fix tests

* Update decencies
  • Loading branch information
hanzei authored and jwilander committed Oct 4, 2018
1 parent a3049ec commit 2176ff8
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 41 deletions.
87 changes: 76 additions & 11 deletions server/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 6 additions & 28 deletions server/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[prune]
non-go = true
go-tests = true
unused-packages = true

Expand All @@ -35,4 +9,8 @@

[[constraint]]
name = "github.com/mattermost/mattermost-server"
branch = "master"
version = "~5.3.0"

[[constraint]]
name = "github.com/stretchr/testify"
version = "~1.2.0"
4 changes: 3 additions & 1 deletion server/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ func (p *Plugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo
return getCommandResponse(model.COMMAND_RESPONSE_TYPE_EPHEMERAL, text), nil
case "help":
text := "###### Mattermost GitHub Plugin - Slash Command Help\n" + strings.Replace(COMMAND_HELP, "|", "`", -1)

return getCommandResponse(model.COMMAND_RESPONSE_TYPE_EPHEMERAL, text), nil
case "":
text := "###### Mattermost GitHub Plugin - Slash Command Help\n" + strings.Replace(COMMAND_HELP, "|", "`", -1)
return getCommandResponse(model.COMMAND_RESPONSE_TYPE_EPHEMERAL, text), nil
case "settings":
if len(parameters) < 2 {
Expand Down
2 changes: 1 addition & 1 deletion server/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ func TestParseGitHubUsernameFromText(t *testing.T) {
}

for _, tc := range tcs {
assert.Equal(t, tc.Expected, pparseGitHubUsernamesFromText(tc.Text))
assert.Equal(t, tc.Expected, parseGitHubUsernamesFromText(tc.Text))
}
}

0 comments on commit 2176ff8

Please sign in to comment.