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

rspec-puppet-facts: Add a way to globally set a facter version

    XMLWordPrintable

    Details

    • Template:
    • Acceptance Criteria:
      Hide
      • There is a way to globally override the facter version that rspec-puppet-facts searches facterdb for.
      • `on_supported_os` helper is updated to default to this new global override
      • The new global override defaults to `Facter.version` to maintain the existing behavior.
      Show
      There is a way to globally override the facter version that rspec-puppet-facts searches facterdb for. `on_supported_os` helper is updated to default to this new global override The new global override defaults to `Facter.version` to maintain the existing behavior.
    • Team:
      Puppet Developer Experience
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      Hide
      Upstream project (rspec-puppet-facts) enhanced to add a `default_facter_version` RSpec option, allowing the user to set the default Facter version used when searching FacterDB with `os_supported_os` in their tests. See https://github.com/mcanevet/rspec-puppet-facts/pull/88 for more info.
      Show
      Upstream project (rspec-puppet-facts) enhanced to add a `default_facter_version` RSpec option, allowing the user to set the default Facter version used when searching FacterDB with `os_supported_os` in their tests. See https://github.com/mcanevet/rspec-puppet-facts/pull/88 for more info.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Currently the `on_supported_os` helper from rspec-puppet-facts defaults to `Facter.version` (which in most cases for gem installs is 2.5.1) and can only be overridden by passing a hash to this method each time you use it (`on_supported_os(facterversion: '3.11.0')`). While this works, its not ideal to have to do this manually in each test.

      A better option would be to have rspec-puppet-facts add a new RSpec setting allowing this to be overridden in a single place in spec_helper.rb eg

      RSpec.configure.do |c|
        c.facterdb_facter_version = '3.11.0'
      end
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tim.sharpe Tim Sharpe
              Reporter:
              tim.sharpe Tim Sharpe
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support