Cannot load such file 'rvm'


#1

Hi,

I have read and reread this thread:

and this comment on another thread specifically:

The recommendation is to put:

Kernel.stub(:require).with(‘rvm’)

somewhere before you load your spec/recipe, but I am not sure where that
would be. For now I have tried putting the two versions of the the
stubbing inside the let block. Unfortunately, neither yielded good
results. Thank you for your help.

Sincerely,
Jimmy

https://gist.github.com/yhuang/f8e24555c127d5be60c0

let(:chef_run) do
Kernel.stub(:require).with(‘rvm’)
ChefSpec::ServerRunner.new.converge(described_recipe)
end

let(:chef_run) do
allow(Kernel).to receive(:require).with(‘rvm’).and_return(true)
ChefSpec::ServerRunner.new.converge(described_recipe)
end