Is there a way to stub a method call with a test value? For example, I want get_folder_name to return 'test' during my ChefSpec test
directory 'Log_Folder' do
def get_folder_name
'c:\temp\folder'
end
action :create
path get_folder_name
end
Tried this but it doesn't replace the value.
before do
allow_any_instance_of(Chef::Resource).to receive(:get_folder_name).and_return('test')
end