Hi there,
is there a way to use the contain_* matchers on ressource parameters? I have a define, which accepts an array which is passed to augeas
define mymodule::mydef (array $raw_changes) {
....
....
augeas { $config_file:
context => $context,
changes => $changes,
lens => $lens,
incl => $config_file
}
}
Now I would like to write a rspec test which checks if there is an augeas ressource by that name and whether it holds the changes I've specified to the define. I simply could check if all my specified changes have made it into the augeas ressource, but I think that this is not very elegant.
it { is_expected.to contain_augeas('/etc/ssh/sshd_config').with_changes(['set HostKey = /etc/ssh/ssh_host_key', 'set Port = 23'])}
I'd rather would do something like this:
ressource_augeas('/etc/ssh/sshd_config').contains_changes('set HostKey = /etc/ssh/ssh_host_key')
Is that possible?
Greetings,
diLLec