ソースを参照

fixed test build error

tags/v1.0.0
Lunny Xiao 7年前
コミット
76604d8f90
2個のファイルの変更8行の追加8行の削除
  1. 6
    6
      models/repo_test.go
  2. 2
    2
      modules/markdown/markdown_test.go

+ 6
- 6
models/repo_test.go ファイルの表示

Convey("It should be nil even if other settings are present", func() { Convey("It should be nil even if other settings are present", func() {
repo.EnableExternalTracker = false repo.EnableExternalTracker = false
repo.ExternalTrackerFormat = "http://someurl.com/{user}/{repo}/{issue}" repo.ExternalTrackerFormat = "http://someurl.com/{user}/{repo}/{issue}"
repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
repo.ExternalTrackerStyle = markdown.IssueNameStyleNumeric
So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil)) So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil))
}) })
}) })
repo.EnableExternalTracker = true repo.EnableExternalTracker = true
Convey("It should default to numeric issue style", func() { Convey("It should default to numeric issue style", func() {
metas := repo.ComposeMetas() metas := repo.ComposeMetas()
So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC)
So(metas["style"], ShouldEqual, markdown.IssueNameStyleNumeric)
}) })
Convey("It should pass through numeric issue style setting", func() { Convey("It should pass through numeric issue style setting", func() {
repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
repo.ExternalTrackerStyle = markdown.IssueNameStyleNumeric
metas := repo.ComposeMetas() metas := repo.ComposeMetas()
So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC)
So(metas["style"], ShouldEqual, markdown.IssueNameStyleNumeric)
}) })
Convey("It should pass through alphanumeric issue style setting", func() { Convey("It should pass through alphanumeric issue style setting", func() {
repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
repo.ExternalTrackerStyle = markdown.IssueNameStyleAlphanumeric
metas := repo.ComposeMetas() metas := repo.ComposeMetas()
So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_ALPHANUMERIC)
So(metas["style"], ShouldEqual, markdown.IssueNameStyleAlphanumeric)
}) })
Convey("It should contain the user name", func() { Convey("It should contain the user name", func() {
metas := repo.ComposeMetas() metas := repo.ComposeMetas()

+ 2
- 2
modules/markdown/markdown_test.go ファイルの表示

metas["format"] = "https://someurl.com/{user}/{repo}/{index}" metas["format"] = "https://someurl.com/{user}/{repo}/{index}"
metas["user"] = "someuser" metas["user"] = "someuser"
metas["repo"] = "somerepo" metas["repo"] = "somerepo"
metas["style"] = ISSUE_NAME_STYLE_NUMERIC
metas["style"] = IssueNameStyleNumeric


Convey("should not render anything when there are no mentions", func() { Convey("should not render anything when there are no mentions", func() {
testCases := []string{ testCases := []string{
metas["format"] = "https://someurl.com/{user}/{repo}/?b={index}" metas["format"] = "https://someurl.com/{user}/{repo}/?b={index}"
metas["user"] = "someuser" metas["user"] = "someuser"
metas["repo"] = "somerepo" metas["repo"] = "somerepo"
metas["style"] = ISSUE_NAME_STYLE_ALPHANUMERIC
metas["style"] = IssueNameStyleAlphanumeric
Convey("It should not render anything when there are no mentions", func() { Convey("It should not render anything when there are no mentions", func() {
testCases := []string{ testCases := []string{
"", "",

読み込み中…
キャンセル
保存