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

Added docs code snippet for createStubInstance #1423

Merged
merged 2 commits into from
May 26, 2017
Merged

Added docs code snippet for createStubInstance #1423

merged 2 commits into from
May 26, 2017

Conversation

JoshuaKGoldberg
Copy link
Contributor

I couldn't think of a third sentence that added to the docs :) but am open to proposals.
Fixes #1421.

I couldn't think of a third sentence that added to the docs :) but am open to proposals.
@coveralls
Copy link

coveralls commented May 25, 2017

Coverage Status

Coverage remained the same at 94.896% when pulling 5b09fbe on JoshuaKGoldberg:patch-1 into ebe37da on sinonjs:master.

@@ -30,7 +30,17 @@ Restores supplied method

#### `sinon.createStubInstance(constructor);`

Creates a new object with the given function as the protoype and stubs all implemented functions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is an improvement. A class IS A function along with its prototype. It's not either/or. Might help the ones that don't know the basics, but still...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Having an explanation that says function and a code snippet with a class should be fine.

contains(item) { /* ... */ }
}

var stubContainer = sinon.createStubInstance(Container);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

@coveralls
Copy link

coveralls commented May 25, 2017

Coverage Status

Coverage remained the same at 94.896% when pulling 75cc7f8 on JoshuaKGoldberg:patch-1 into ebe37da on sinonjs:master.

@mroderick
Copy link
Member

Thank you @JoshuaKGoldberg!

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

Successfully merging this pull request may close these issues.

None yet

4 participants