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 puppet-users...@googlegroups.com.
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.
-- Johan De Wit Open Source Consultant Red Hat Certified Engineer (805008667232363) Puppet Certified Professional 2013 (PCP0000006) _________________________________________________________ Open-Future Phone +32 (0)2/255 70 70 Zavelstraat 72 Fax +32 (0)2/255 70 71 3071 KORTENBERG Mobile +32 (0)474/42 40 73 BELGIUM http://www.open-future.be _________________________________________________________
Upcoming Events:
Puppet Advanced Training | http://www.open-future.be/puppet-advanced-training-7-till-9th-january
Puppet Fundamentals Training | http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february
Subscribe to our newsletter: http://eepurl.com/BUG8H