[chef] chefspec and chef-sugar


Chronological Thread 
  • From: Daniel Givens < >
  • To: " " < >
  • Subject: [chef] chefspec and chef-sugar
  • Date: Fri, 7 Aug 2015 16:58:24 +0000
  • Accept-language: en-US

When I test a recipe with chefspec that has 'encrypted_data_bag_item' from chef-sugar, I get an error about the encrypted data bag secret config not being set. I'm not sure how to stub that out.


I don't know ruby much more than what's necessary for chef, so I'm struggling with how to stub that out. This was my attempt:


allow(Chef::Sugar::Databag).to recieve(:encrypted_data_bag_item).with('ssl', 'dhparam', 'not_nil').and_return({
  'parameters' => 'parameters'
})


I get the exception 'uninitialized constant Chef::Sugar'. Any help would be very much appreciated.


Thanks!


Daniel





Archive powered by MHonArc 2.6.16.

§