Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
- The magic mocha default of PSH is harmful by obscuring what's going on.
- By default both mocha and rspec-mocks is installed, leading to confusing test suites that are using both forms.
- Mocha is polluting the global ruby namespace when testing, which can lead to subtle issues when there is a overlap with code in the project.
- mocha is an additional dependency to carry.
As a first step, we should ask folks to
- explicitly specify which mocking framework they want to use
- do not override that choice
See https://github.com/puppetlabs/puppetlabs_spec_helper/blob/6c8aa5b921f96e860b0f5f92dde13647572122ff/lib/puppetlabs_spec_helper/puppet_spec_helper.rb#L122 and https://github.com/puppetlabs/puppetlabs_spec_helper/blob/07efb9d5a90498ffcb9ac7b16caf8a96c3c160da/lib/puppetlabs_spec_helper/module_spec_helper.rb#L29 and https://github.com/puppetlabs/puppetlabs_spec_helper/pull/239
While this transition is ongoing, PSH should still keep its current behaviour, to give people time to migrate.
Attachments
Issue Links
- relates to
-
MODULES-1902 module_spec_helper raises error when mocking using rspec-mocks
-
- Resolved
-