summaryrefslogtreecommitdiff
path: root/spec/unit/provider/dsc_resource_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/dsc_resource_spec.rb')
-rw-r--r--spec/unit/provider/dsc_resource_spec.rb13
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..9946ab8410 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(:dsc_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(:dsc_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(:dsc_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)