diff options
Diffstat (limited to 'spec/functional/resource/dsc_resource_spec.rb')
-rw-r--r-- | spec/functional/resource/dsc_resource_spec.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/functional/resource/dsc_resource_spec.rb b/spec/functional/resource/dsc_resource_spec.rb index 24503f1ec7..07c0bf5eb9 100644 --- a/spec/functional/resource/dsc_resource_spec.rb +++ b/spec/functional/resource/dsc_resource_spec.rb @@ -16,12 +16,12 @@ # limitations under the License. # -require 'spec_helper' +require "spec_helper" describe Chef::Resource::DscResource, :windows_powershell_dsc_only do before(:all) do @ohai = Ohai::System.new - @ohai.all_plugins(['platform', 'os', 'languages/powershell']) + @ohai.all_plugins(["platform", "os", "languages/powershell"]) end let(:event_dispatch) { Chef::EventDispatch::Dispatcher.new } @@ -38,25 +38,25 @@ describe Chef::Resource::DscResource, :windows_powershell_dsc_only do Chef::Resource::DscResource.new("dsc_resource_test", run_context) } - context 'when Powershell does not support Invoke-DscResource' - context 'when Powershell supports Invoke-DscResource' do + context "when Powershell does not support Invoke-DscResource" + context "when Powershell supports Invoke-DscResource" do before do if !Chef::Platform.supports_dsc_invoke_resource?(node) - skip 'Requires Powershell >= 5.0.10018.0' + skip "Requires Powershell >= 5.0.10018.0" elsif !Chef::Platform.dsc_refresh_mode_disabled?(node) - skip 'Requires LCM RefreshMode is Disabled' + skip "Requires LCM RefreshMode is Disabled" end end - context 'with an invalid dsc resource' do - it 'raises an exception if the resource is not found' do - new_resource.resource 'thisdoesnotexist' + context "with an invalid dsc resource" do + it "raises an exception if the resource is not found" do + new_resource.resource "thisdoesnotexist" expect { new_resource.run_action(:run) }.to raise_error( Chef::Exceptions::ResourceNotFound) end end - context 'with a valid dsc resource' do - let(:tmp_file_name) { Dir::Tmpname.create('tmpfile') {} } + context "with a valid dsc resource" do + let(:tmp_file_name) { Dir::Tmpname.create("tmpfile") {} } let(:test_text) { "'\"!@#$%^&*)(}{][\u2713~n"} before do @@ -69,16 +69,16 @@ describe Chef::Resource::DscResource, :windows_powershell_dsc_only do File.delete(tmp_file_name) if File.exists? tmp_file_name end - it 'converges the resource if it is not converged' do + it "converges the resource if it is not converged" do new_resource.run_action(:run) - contents = File.open(tmp_file_name, 'rb:bom|UTF-16LE') do |f| - f.read.encode('UTF-8') + contents = File.open(tmp_file_name, "rb:bom|UTF-16LE") do |f| + f.read.encode("UTF-8") end expect(contents).to eq(test_text) expect(new_resource).to be_updated end - it 'does not converge the resource if it is already converged' do + it "does not converge the resource if it is already converged" do new_resource.run_action(:run) expect(new_resource).to be_updated reresource = |