generator_files/spec/chefspec_helper.rb in teststrap-1.1.8 vs generator_files/spec/chefspec_helper.rb in teststrap-1.2.0
- old
+ new
@@ -1,11 +1,9 @@
-def mock_encrypted_databag(bag, key, return_value)
- stub_data_bag_item('encryption_keys', 'databag_encryption_key').
- and_return({ 'id' => 'databag_encryption_key', 'key' => 'secret' })
+require 'chefspec'
+require 'chefspec/berkshelf'
+require 'chef-vault'
- allow(Chef::EncryptedDataBagItem).to receive(:load_secret).
- and_return('secret')
-
- expect(Chef::EncryptedDataBagItem).to receive(:load).
- with(bag, key, 'secret').
+def mock_encrypted_databag(bag, key, return_value)
+ allow(ChefVault::Item).to receive(:load).
+ with(bag, key).
and_return(return_value)
end