README.md in puppetlabs_spec_helper-2.10.0 vs README.md in puppetlabs_spec_helper-2.11.0

- old
+ new

@@ -189,11 +189,11 @@ file named `.fixtures.yml` in the root of the project. You can specify a alternate location for that file in the `FIXTURES_YML` environment variable. You can use the `MODULE_WORKING_DIR` environment variable to specify a diffent location when installing module fixtures via the forge. By default the working directory is `<module directory>/spec/fixtures/work-dir`. -When specifying the repo source of the fixture you have a few options as to which revision of the codebase you wish to use. +When specifying the repo source of the fixture you have a few options as to which revision of the codebase you wish to use, and optionally, the puppet versions where the fixture is needed. * repo - the url to the repo * scm - options include git or hg. This is an optional step as the helper code will figure out which scm is used. ```yaml @@ -213,11 +213,16 @@ * flags - additional flags passed to the module installer (both puppet and scm) ```yaml flags: --verbose ``` + * puppet_version - versions of puppet for which the fixture should be installed. Ruby version constraints are supported. Only works when the `semantic_puppet` gem is available (shipped with puppet 4.0 and up, by default). + ```yaml + puppet_version: '>= 6.0.0' + ``` + **Note:** ref and branch can be used together to get a specific revision on a specific branch Fixtures Examples ----------------- Basic fixtures that will symlink `spec/fixtures/modules/my_modules` to the @@ -261,10 +266,20 @@ stdlib: repo: "git://github.com/puppetlabs/puppetlabs-stdlib" ref: "2.6.0" ``` +Only install the `yumrepo_core` module when testing against Puppet 6 or greater: + +```yaml +fixtures: + repositories: + yumrepo_core: + repo: "git://github.com/puppetlabs/puppetlabs-yumrepo_core" + puppet_version: ">= 6.0.0" +``` + Move manifests and siblings to root directory when they are inside a `code` directory: ```yaml fixtures: repositories: @@ -459,19 +474,19 @@ ``` context.stubs(:some_method).with(arguments).returns('value') ``` to this: ``` -allow(context).to receive(:some_method).with(arguments).and_returns('value') +allow(context).to receive(:some_method).with(arguments).and_return('value') ``` Translate all expectations: ``` context.expects(:some_method).with(arguments).returns('value') ``` to this: ``` -expect(context).to receive(:some_method).with(arguments).and_returns('value') +expect(context).to receive(:some_method).with(arguments).and_return('value') ``` Rationale ---------