diff --git a/Gemfile b/Gemfile index c4ab09be22..0c1f466db6 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ group :test, :integration do end group :test do - gem 'chefspec', '~> 4.0' + gem 'chefspec', '~> 4.0', '< 4.1' # elecksee is lxc dependency gem 'elecksee', '~> 1.0.20' gem 'foodcritic', '~> 3.0.3' diff --git a/spec/aufs_spec.rb b/spec/aufs_spec.rb index 844e42341a..5eb1ecf590 100644 --- a/spec/aufs_spec.rb +++ b/spec/aufs_spec.rb @@ -8,7 +8,7 @@ apt_cache = double('apt-cache') uname = double - Mixlib::ShellOut.stub(:new).and_return(shellout) + allow(Mixlib::ShellOut).to receive(:new).and_return(shellout) allow(shellout).to receive(:run_command).and_return(apt_cache) allow(apt_cache).to receive(:stdout).and_return('linux-image-extra-3.') allow(shellout).to receive(:run_command).and_return(uname) diff --git a/spec/default_spec.rb b/spec/default_spec.rb index 2684d8da85..b75538b76c 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -8,7 +8,7 @@ apt_cache = double('apt-cache') uname = double - Mixlib::ShellOut.stub(:new).and_return(shellout) + allow(Mixlib::ShellOut).to receive(:new).and_return(shellout) allow(shellout).to receive(:run_command).and_return(apt_cache) allow(apt_cache).to receive(:stdout).and_return('linux-image-extra-3.') allow(shellout).to receive(:run_command).and_return(uname) diff --git a/spec/dep_check_spec.rb b/spec/dep_check_spec.rb index 3a75621e63..ece177db27 100644 --- a/spec/dep_check_spec.rb +++ b/spec/dep_check_spec.rb @@ -8,8 +8,8 @@ end before do - Chef::Recipe.any_instance.stub(:binary_installed?).with('VboxManage').and_return(false) - Chef::Recipe.any_instance.stub(:binary_installed?).with('boot2docker').and_return(false) + allow_any_instance_of(Chef::Recipe).to receive(:binary_installed?).with('VboxManage').and_return(false) + allow_any_instance_of(Chef::Recipe).to receive(:binary_installed?).with('boot2docker').and_return(false) end it 'should fail if it can\'t find VirtualBox or if VirtualBox is not in the run_list' do