Skip to content

Commit

Permalink
Add Glide to support manage dependent packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngdinhtoan committed Jan 22, 2016
1 parent b1ca363 commit 9eb43be
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# git ignore config project here

config.yml
/vendor

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
Expand Down
52 changes: 52 additions & 0 deletions glide.lock

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

6 changes: 6 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package: github.com/ngdinhtoan/slackcmd
import:
- package: github.com/ngdinhtoan/go-jira-client
version: d9a7c542ec2b1603bb948c3dcc112b4643388aad
- package: github.com/spf13/viper
version: a212099cbe6fbe8d07476bfda8d2d39b6ff8f325
12 changes: 12 additions & 0 deletions payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"net/url"
"testing"

"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -33,3 +34,14 @@ func TestPayload(t *testing.T) {
assert.True(payload.IsValid())
assert.False(payload.IsPrivateGroup())
}

func TestTokenValidator(t *testing.T) {
viper.Set("slackcmd.tokens", map[string]string{"ticket": "94972394739423492"})
validator := NewTokenValidator()

err := validator.Validate(&Payload{Token: "abcelksjdfldsf", Command: "/ticket"})
assert.Equal(t, ErrTokenInvalid, err)

err = validator.Validate(&Payload{Token: "94972394739423492", Command: "/ticket"})
assert.Nil(t, err)
}

0 comments on commit 9eb43be

Please sign in to comment.