diff options
author | Claire McQuin <claire@getchef.com> | 2015-09-08 12:20:45 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2015-09-08 13:24:25 -0700 |
commit | 998e13adbda5e964d2f8d17ebd8f216f752244a6 (patch) | |
tree | 6bd0c042229dca9865bc37a81a87bc1c7bf23d83 /spec/unit/provider | |
parent | 530119278f6a71eef4b0bf02df022218a96dcecc (diff) | |
download | chef-998e13adbda5e964d2f8d17ebd8f216f752244a6.tar.gz |
Skip tests unless RefreshMode is Disabled
Diffstat (limited to 'spec/unit/provider')
-rw-r--r-- | spec/unit/provider/dsc_resource_spec.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb index 65c1c019f0..807a844346 100644 --- a/spec/unit/provider/dsc_resource_spec.rb +++ b/spec/unit/provider/dsc_resource_spec.rb @@ -50,30 +50,23 @@ describe Chef::Provider::DscResource do } context 'when RefreshMode is not set to Disabled' do - let (:meta_configuration) { {'RefreshMode' => 'AnythingElse'}} - it 'raises an exception' do - expect(provider).to receive(:meta_configuration).and_return( - meta_configuration) + expect(provider).to receive(:refresh_mode_disabled?).and_return(false) expect { provider.run_action(:run) }.to raise_error( Chef::Exceptions::ProviderNotFound, /Disabled/) end end context 'when RefreshMode is set to Disabled' do - let (:meta_configuration) { {'RefreshMode' => 'Disabled'}} - it 'does not update the resource if it is up to date' do - expect(provider).to receive(:meta_configuration).and_return( - meta_configuration) + expect(provider).to receive(:refresh_mode_disabled?).and_return(true) expect(provider).to receive(:test_resource).and_return(true) provider.run_action(:run) expect(resource).not_to be_updated end it 'converges the resource if it is not up to date' do - expect(provider).to receive(:meta_configuration).and_return( - meta_configuration) + expect(provider).to receive(:refresh_mode_disabled?).and_return(true) expect(provider).to receive(:test_resource).and_return(false) expect(provider).to receive(:set_resource) provider.run_action(:run) |