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

Mocha guidance #38

Open
andyw8 opened this issue Nov 26, 2020 · 0 comments
Open

Mocha guidance #38

andyw8 opened this issue Nov 26, 2020 · 0 comments

Comments

@andyw8
Copy link
Contributor

andyw8 commented Nov 26, 2020

To start off the Mocha section (#37) I would propose these as recommended configuration settings:

 Mocha.configure do |c|
   c.stubbing_method_on_nil = :prevent
   c.stubbing_non_existent_method = :prevent
   c.stubbing_non_public_method = :prevent
 end

The first two can prevent subtle bugs which may cause false passes.

The third encourages better design by avoiding tests having knowledge of private implementation details.

https://mocha.jamesmead.org/Mocha/Configuration.html

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

1 participant