當前位置: 首頁>>代碼示例>>Golang>>正文


Golang format.Message函數代碼示例

本文整理匯總了Golang中github.com/cloudfoundry-incubator/docker_app_lifecycle/Godeps/_workspace/src/github.com/onsi/gomega/format.Message函數的典型用法代碼示例。如果您正苦於以下問題:Golang Message函數的具體用法?Golang Message怎麽用?Golang Message使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Message函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: NegatedFailureMessage

func (matcher *HaveKeyMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	switch matcher.Key.(type) {
	case omegaMatcher:
		return format.Message(actual, "not to have key matching", matcher.Key)
	default:
		return format.Message(actual, "not to have key", matcher.Key)
	}
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:8,代碼來源:have_key_matcher.go

示例2: FailureMessage

func (m *exitMatcher) FailureMessage(actual interface{}) (message string) {
	if m.actualExitCode == -1 {
		return "Expected process to exit.  It did not."
	} else {
		return format.Message(m.actualExitCode, "to match exit code:", m.exitCode)
	}
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:7,代碼來源:exit_matcher.go

示例3: NegatedFailureMessage

func (m *exitMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	if m.actualExitCode == -1 {
		return "you really shouldn't be able to see this!"
	} else {
		if m.exitCode == -1 {
			return "Expected process not to exit.  It did."
		} else {
			return format.Message(m.actualExitCode, "not to match exit code:", m.exitCode)
		}
	}
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:11,代碼來源:exit_matcher.go

示例4: FailureMessage

func (matcher *HaveKeyWithValueMatcher) FailureMessage(actual interface{}) (message string) {
	str := "to have {key: value}"
	if _, ok := matcher.Key.(omegaMatcher); ok {
		str += " matching"
	} else if _, ok := matcher.Value.(omegaMatcher); ok {
		str += " matching"
	}

	expect := make(map[interface{}]interface{}, 1)
	expect[matcher.Key] = matcher.Value
	return format.Message(actual, str, expect)
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:12,代碼來源:have_key_with_value_matcher.go

示例5: NegatedFailureMessage

func (matcher *HaveKeyWithValueMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	kStr := "not to have key"
	if _, ok := matcher.Key.(omegaMatcher); ok {
		kStr = "not to have key matching"
	}

	vStr := "or that key's value not be"
	if _, ok := matcher.Value.(omegaMatcher); ok {
		vStr = "or to have that key's value not matching"
	}

	return format.Message(actual, kStr, matcher.Key, vStr, matcher.Value)
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:13,代碼來源:have_key_with_value_matcher.go

示例6: FailureMessage

func (matcher *ReceiveMatcher) FailureMessage(actual interface{}) (message string) {
	subMatcher, hasSubMatcher := (matcher.Arg).(omegaMatcher)

	closedAddendum := ""
	if matcher.channelClosed {
		closedAddendum = " The channel is closed."
	}

	if hasSubMatcher {
		if matcher.receivedValue.IsValid() {
			return subMatcher.FailureMessage(matcher.receivedValue.Interface())
		}
		return "When passed a matcher, ReceiveMatcher's channel *must* receive something."
	} else {
		return format.Message(actual, "to receive something."+closedAddendum)
	}
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:17,代碼來源:receive_matcher.go

示例7: NegatedFailureMessage

func (matcher *BeNilMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to be nil")
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:be_nil_matcher.go

示例8: NegatedFailureMessage

func (matcher *MatchErrorMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to match error", matcher.Expected)
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:match_error_matcher.go

示例9: NegatedFailureMessage

func (matcher *BeNumericallyMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, fmt.Sprintf("not to be %s", matcher.Comparator), matcher.CompareTo[0])
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:be_numerically_matcher.go

示例10: FailureMessage

func (matcher *BeEmptyMatcher) FailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "to be empty")
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:be_empty_matcher.go

示例11: NegatedFailureMessage

func (matcher *BeClosedMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "to be open")
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:be_closed_matcher.go

示例12: NegatedFailureMessage

func (matcher *BeZeroMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to be zero-valued")
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:be_zero_matcher.go

示例13: NegatedFailureMessage

func (matcher *MatchJSONMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	actualString, expectedString, _ := matcher.prettyPrint(actual)
	return format.Message(actualString, "not to match JSON of", expectedString)
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:4,代碼來源:match_json_matcher.go

示例14: NegatedFailureMessage

func (matcher *EqualMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to equal", matcher.Expected)
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:equal_matcher.go

示例15: NegatedFailureMessage

func (matcher *AssignableToTypeOfMatcher) NegatedFailureMessage(actual interface{}) string {
	return format.Message(actual, fmt.Sprintf("not to be assignable to the type: %T", matcher.Expected))
}
開發者ID:guanglinlv,項目名稱:docker_app_lifecycle,代碼行數:3,代碼來源:assignable_to_type_of_matcher.go


注:本文中的github.com/cloudfoundry-incubator/docker_app_lifecycle/Godeps/_workspace/src/github.com/onsi/gomega/format.Message函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。