-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract failure messages into separate methods
Previously formatting early could lead to race conditions as it formatted the object under test. (This also makes the interface a bit clearer.) Signed-off-by: Ted Young <tyoung@pivotallabs.com>
- Loading branch information
Alex Suraci
authored and
Ted Young
committed
Apr 15, 2014
1 parent
fce6040
commit b88ba4e
Showing
44 changed files
with
427 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the documentation. At the moment writing your own matcher seems an impossible task for new users.
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vito @tedsuo Also, I feel this could have been done better. Why do you break the API just like this? You could have created a new interface and deal with the changes internally instead of forcing all your users to reflect the change in their own code. Rather unnecessary changes at that.
And Go's non-existent dependency management makes this even worse.
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry the changes caught you unawares. Ginkgo is in beta, so we are still making breaking changes, at least for the next few weeks.
Regarding the new interface, it was needed to prevent failure message generation from triggering the race detector on passing tests. The solution was to separate message generation from testing. We also felt this cleaned the interface up by separating concerns, which will make matchers easier to write. We pushed documentation changes as well, let us know if they're not clear.
Breaking changes combined with users pulling against HEAD definitely exposes the problem a lack of shared dependency management solutions introduces. :/
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tedsuo Didn't see anything that declares Gomega as beta. Maybe I missed it. Under those circumstances I can see why you made a breaking change. I was under the impression Gomega was rather stable.
About the documentation, the documentation still mentions the old OmegaMatcher interface.
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephanos I'm sorry for the pain this cause you. I'm going to add a 1,0 milestone for Gomega, after which these sort of breaking changes will not be allowed in.
The change is for the better and should have been done long ago, but should have been phased in more slowly.. FWIW I don't see there being any other breaking changes on the road to 1.0 - just new features.
As for the docs, I'll update the bit that defines the interface. The example beneath was already updated by @vito and @tedsuo
Again - apologies!
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what? Let me do better than just that. I'll jerry rig support for the old style in as well and have Gomega print out a deprecation warning so you won't have to change your code right away.
b88ba4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty. The docs are fixed #17 and the old-style matchers work again (and print a deprecation warning) #18. Sorry for the churn @stephanos!