Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show threshold in failure message of BeNumericallyMatcher #293

Merged
merged 1 commit into from Aug 7, 2018

Conversation

grosser
Copy link
Contributor

@grosser grosser commented Jul 20, 2018

Copy link
Sponsor Collaborator

@williammartin williammartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I think it's really useful, just a few comments.

if !positive {
formatted = "not " + formatted
}
formatted = format.Message(actual, formatted, matcher.CompareTo[0])
Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just return here in place of setting the formatted variable and then returning?

}

func (matcher *BeNumericallyMatcher) FormatFailureMessage(actual interface{}, positive bool) (message string) {
var formatted string
Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following on from the comment below, maybe we could just rename this to message, since it's the thing that will be formatted, instead of the thing that is formatted.

return matcher.FormatFailureMessage(actual, false)
}

func (matcher *BeNumericallyMatcher) FormatFailureMessage(actual interface{}, positive bool) (message string) {
Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe change positive here to negated, and flip the boolean expressions to be consistent with the Method names. Also, can we make this private formatFailureMessage?

@grosser
Copy link
Contributor Author

grosser commented Aug 7, 2018

updated @williammartin

@williammartin williammartin merged commit 4bbecc8 into onsi:master Aug 7, 2018
@williammartin
Copy link
Sponsor Collaborator

LGTM thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants