• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang format.Message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/jwaldrip/odin/Godeps/_workspace/src/github.com/onsi/gomega/format.Message函数的典型用法代码示例。如果您正苦于以下问题:Golang Message函数的具体用法?Golang Message怎么用?Golang Message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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:spekode,项目名称:odin,代码行数: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:spekode,项目名称:odin,代码行数: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:spekode,项目名称:odin,代码行数: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:spekode,项目名称:odin,代码行数: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:spekode,项目名称:odin,代码行数: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:spekode,项目名称:odin,代码行数:17,代码来源:receive_matcher.go


示例7: 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:spekode,项目名称:odin,代码行数:3,代码来源:be_numerically_matcher.go


示例8: 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:spekode,项目名称:odin,代码行数:3,代码来源:assignable_to_type_of_matcher.go


示例9: FailureMessage

func (matcher *BeFalseMatcher) FailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "to be false")
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_false_matcher.go


示例10: NegatedFailureMessage

func (matcher *ContainSubstringMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to contain substring", matcher.stringToMatch())
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:contain_substring_matcher.go


示例11: NegatedFailureMessage

func (matcher *ConsistOfMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to consist of", matcher.Elements)
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:consist_of.go


示例12: NegatedFailureMessage

func (matcher *BeEmptyMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to be empty")
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_empty_matcher.go


示例13: NegatedFailureMessage

func (matcher *BeClosedMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "to be open")
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_closed_matcher.go


示例14: FailureMessage

func (matcher *BeNilMatcher) FailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "to be nil")
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_nil_matcher.go


示例15: NegatedFailureMessage

func (matcher *MatchRegexpMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to match regular expression", matcher.regexp())
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:match_regexp_matcher.go


示例16: FailureMessage

func (matcher *BeTemporallyMatcher) FailureMessage(actual interface{}) (message string) {
	return format.Message(actual, fmt.Sprintf("to be %s", matcher.Comparator), matcher.CompareTo)
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_temporally_matcher.go


示例17: NegatedFailureMessage

func (matcher *BeEquivalentToMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to be equivalent to", matcher.Expected)
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_equivalent_to_matcher.go


示例18: FailureMessage

func (matcher *BeClosedMatcher) FailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "to be closed")
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_closed_matcher.go


示例19: NegatedFailureMessage

func (matcher *EqualMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to equal", matcher.Expected)
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:equal_matcher.go


示例20: NegatedFailureMessage

func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) {
	return format.Message(actual, "not to be true")
}
开发者ID:spekode,项目名称:odin,代码行数:3,代码来源:be_true_matcher.go



注:本文中的github.com/jwaldrip/odin/Godeps/_workspace/src/github.com/onsi/gomega/format.Message函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang mancala.PlayerIndex类代码示例发布时间:2022-05-23
下一篇:
Golang failer.Failer类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap