Open TraGicCode opened 7 years ago
There is currently no way to check this. Using your method as a basis, it should be straightforward to implement a with_redacted_#{attrname}
matcher.
Have a look at https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet/matchers/create_generic.rb and https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet/matchers/dynamic_matchers.rb#L4 how the existing matchers are hooked up.
Related: To input a Sensitive
wrapper, one currently has to use RawString
like in ref()
(See https://github.com/rodjek/rspec-puppet/blob/7a49bef36884da50d399cdf74aff59e2e8f37389/lib/rspec-puppet/support.rb#L453-L455) . Adding a sensitive()
helper similar to ref()
would be a good addition if this gets picked up.
@DavidS Hasn't this been done with https://github.com/rodjek/rspec-puppet/commit/60549f701648cffe980ffa4e816cf19a67d2baa6 already? :)
The tyranny of time! This issue really needs to be closed as its been implemented for quite a while. As a reference, the code also includes some tests: https://github.com/rodjek/rspec-puppet/blob/c4ceecde20c9c53a388587dd37d6a2fc5dac50e5/spec/classes/test_sensitive_spec.rb#L4
It would be nice to be able to write a unit test that will verify you expect a certain property on a resource to have it's value redacted in the compiled catalog. Below is currently what i'm doing. Is there anyway we can get a thread going on how this can be implemented as a built in solution for rspec-puppet?