spec/rake/funnel/support/msdeploy/registry_patch_spec.rb in rake-funnel-0.12.0.pre vs spec/rake/funnel/support/msdeploy/registry_patch_spec.rb in rake-funnel-0.13.0.pre

- old
+ new

@@ -1,6 +1,10 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do + before { + allow_any_instance_of(described_class).to receive(:warn) + } + describe 'execution' do it 'should yield block' do result = 0 described_class.new do @@ -78,9 +82,23 @@ it 'should delete the key' do keys.each do |key| expect(key).to have_received(:delete_key).with(File.basename(key.keyname), true) end + end + end + + context 'registry access is denied' do + before { + allow(root).to receive(:create).and_raise(::Win32::Registry::Error.new(5)) + } + + before { + described_class.new + } + + it 'should warn' do + expect(subject).to have_received(:warn).with(/Could not patch registry to pretend MSDeploy is installed/) end end context 'MSDeploy registry key does exist' do before {