-
Notifications
You must be signed in to change notification settings - Fork 470
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
Documentation for DetachedMockFactory #1728
Documentation for DetachedMockFactory #1728
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1728 +/- ##
=========================================
Coverage 80.44% 80.44%
Complexity 4336 4336
=========================================
Files 441 441
Lines 13529 13529
Branches 1705 1705
=========================================
Hits 10884 10884
Misses 2007 2007
Partials 638 638 ☔ View full report in Codecov by Sentry. |
@AndreasTu, thanks for taking the initiative here. I am not the type of person who comments in a code review, kinda remote-controlling and micro-managing my peers by telling the exactly which changes I suggest. I would rather opt to commit on top of your changes and collaborate with you that way. Would you mind giving me commit rights in your forked repo? Or would you rather have me create a forked PM, also on top of your changes? I am not a committer here, so the "Allow edits and access to secrets by maintainers" option does not have any effect on me, even though you might have activated it. What I would change:
|
Sorry for being slow, @AndreasTu. I had noticed that you added me as a committer on your fork and started working on this PR a couple of days ago, but then was busy otherwise. Just now when trying to push my commit, I realised that I had to rebase first and that in the meantime you had also added an example for using a custom default response. My example is somewhat more verbose, also trying to create a sense of how to use it with a class under test and an injected mock. I also have an example for @leonard84, DYT it is OK to quote more code in the Spock manual? I felt like some snippets out of context might not do a proper job at explaining how to use detached mocks. |
5dc1f92
to
1f46cc1
Compare
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.
looking good, some things to refine
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Outdated
Show resolved
Hide resolved
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Outdated
Show resolved
Hide resolved
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Show resolved
Hide resolved
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Outdated
Show resolved
Hide resolved
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Outdated
Show resolved
Hide resolved
Added a new section "Create Mock Objects outside Specifications" in the interaction_based_testing.adoc to document usage of the DetachedMockFactory. Added reference to the new section to AutoAttach. This fixes spockframework#1057
TODO: Find out why overriding default behaviour after attaching the detached mock does not work as expected.
64c8163
to
eec3769
Compare
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Outdated
Show resolved
Hide resolved
...-specs/src/test/groovy/org/spockframework/docs/interaction/DetachedMockFactoryDocSpec.groovy
Show resolved
Hide resolved
…n/DetachedMockFactoryDocSpec.groovy Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
…n/DetachedMockFactoryDocSpec.groovy Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
Added a new section "Create Mock Objects outside Specifications" in the interaction_based_testing.adoc to document usage of the DetachedMockFactory. Added reference to the new section to AutoAttach.
This fixes #1057