Skip to content

Trusted external data testing doesn't work #131

@baurmatt

Description

@baurmatt

Describe the Bug

Testing trusted external data as described in https://github.com/puppetlabs/rspec-puppet/?tab=readme-ov-file#specifying-trusted-external-data doesn't work

Expected Behavior

It works :yay:

Steps to Reproduce

Steps to reproduce the behavior:

  1. pdk new module foo --skip-interview && cd foo
  2. pdk new function bar
  3. sed -i 's,\$value \* 2,fail("Trusted external data is: ${trusted['external']}"),' functions/bar.pp
  4. sed -i 's,# with your expectations,let(:trusted_external_data) { {'foo' => 'bar'} },g' spec/functions/bar_spec.rb
  5. pdk test unit

=> See the output, grep for Trusted external data is: {}

Environment

  • PDK Version: 3.3.0
  • Puppet Version: 8.8.1
  • rspec-puppet Version: 5.0.0
  • OS Version: MacOS 15.1.1

Additional Context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions