I''m looking for a way to stub a parser function within rspec-puppet.
This
function returns data based on a database query and I''d rather not have
to
populate dummy data inside my rspec tests.
I can redefine the function by doing something like the following:
Puppet::Parser::Functions::rmfunction("lookup_facts")
Puppet::Parser::Functions::newfunction(:lookup_facts, :type => :rvalue) {
''127.0.0.1'' }
but it isn''t in effect on the resulting catalog during the tests.
I''m thinking that either the catalog is already generated or
I''m not
telling the compiler to use the updated function.
Any suggestions?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/javpnGfLZfAJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.