Uploaded image for project: 'integration-packaging'
  1. integration-packaging
  2. INTPAK-160

Fix "Mocha methods cannot be used outside the context of a test"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • High
    • Resolution: Done
    • None

    Description

      Calling some test functions outside of test blocks seems to now fail tests.

      See all of the recent puppet-test-full-STEAM jobs:

      An error occurred while loading ./spec/unit/provider/jks_spec.rb.
      Failure/Error: File.any_instance.stubs(:file?).returns(true)

      Mocha::NotInitializedError:
      Mocha methods cannot be used outside the context of a test

      1. ./spec/unit/provider/jks_spec.rb:6:in `<top (required)>'

      Deprecation Warnings:

      puppetlabs_spec_helper: defaults `mock_with` to `:mocha`. See https://github.com/puppetlabs/puppetlabs_spec_helper#mock_with to choose a sensible value for you

      https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/puppet-test-full-master/405/console.log.gz

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dfarrell07 Daniel Farrell
            dfarrell07 Daniel Farrell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: