Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-916

puppetlabs_spec_helper - deprecate mocha mock_with default

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.5.0
    • Component/s: None
    • QA Risk Assessment:
      Needs Assessment

      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

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  david.schmitt David Schmitt
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: