Skip to content

Mocha guidance #38

@andyw8

Description

@andyw8

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions