I'm looking to do this as well. Did you ever have any luck?
On Friday, July 27, 2012 8:44:08 AM UTC-6, James Stremick wrote:
>
>
> 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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/b7083977-2776-47e0-be96-cb81e7ebe722%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.