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

Error in partial mock documentation #528

Closed
Arthur-Milchior opened this issue Jun 19, 2023 · 1 comment
Closed

Error in partial mock documentation #528

Arthur-Milchior opened this issue Jun 19, 2023 · 1 comment

Comments

@Arthur-Milchior
Copy link

In https://ocmock.org/reference/ you wrote:

When a method is stubbed and that method is invoked using a reference to the real object, the mock will still be able to handle the invocation. Similarly, when a method is invoked using a reference to anObject, rather than the mock, it can still be verified later.

I believe that anObject is the real object. So your sentence is repeating twice the same thing. Instead, I suspect that something such as

When a method myMethod is stubbed, both [anObject myMethod] and [partialMock myMethod] will use the mocked method, and can be verified later.

Relatedly: I’d have sens this as a PR, but I can’t figure out where the documentation is hosted, if anywhere; that may also be interesting to document

@erikdoe
Copy link
Owner

erikdoe commented Oct 3, 2023

Agreed, the sentences are a little awkward, but they're not repeating the same statement. The first sentence says that when you use the real object the mock is able to "handle" the invocation. That's meant to say any stub that's set up will be used. The second sentence says that when you use the real object you can verify that the method was invoked. The confusion likely arises because "handle" can be understood to imply that you can verify later. I'll make a fix.

The documentation is hosted via GitHub pages. It is in a branch named gh-pages. That's standard GitHub functionality, but maybe not well known.

erikdoe added a commit that referenced this issue Oct 3, 2023
@erikdoe erikdoe closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants