diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-03 13:28:01 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-03 13:28:01 -0800 |
commit | 49b6276e5a6cb07a1923376c956080e3d425ee23 (patch) | |
tree | a5dd3cced8753e39e555e4ad3ccd828beb4e3c59 /spec | |
parent | 209a9cc2f3eaa1c2046bae485d69d52f4e11399e (diff) | |
download | chef-49b6276e5a6cb07a1923376c956080e3d425ee23.tar.gz |
auto-fixing some easy copschefstyle/fixes
3 Performance/CaseWhenSplat: Place when conditions with a splat at the end of the when branches.
1 Style/ElseAlignment: Align else with if.
1 Style/EvenOdd: Replace with Fixnum#even?.
1 Style/MethodDefParentheses: Use def with parentheses when there are parameters.
3 Style/PercentQLiterals: Do not use %Q unless interpolation is needed. Use %q.
3 Style/SpaceAfterColon: Space missing after colon.
2 Style/SpaceAfterMethodName: Do not put a space between a method name and the opening parenthesis.
2 Style/Tab: Tab detected.
1 Style/TrailingUnderscoreVariable: Do not use trailing _s in parallel assignment.
1 Style/UnneededCapitalW: Do not use %W unless interpolation is needed. If not, use %w.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/event_loggers/windows_eventlog_spec.rb | 2 | ||||
-rw-r--r-- | spec/functional/resource/directory_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/knife_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/key_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/service/debian_service_spec.rb | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb index f4e5e8a88a..0f59e64f25 100644 --- a/spec/functional/event_loggers/windows_eventlog_spec.rb +++ b/spec/functional/event_loggers/windows_eventlog_spec.rb @@ -39,7 +39,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only, :not_supported_o let(:run_status) { double("Run Status", {run_id: run_id, elapsed_time: elapsed_time }) } let(:event_log) { EventLog.new("Application") } let!(:offset) { event_log.read_last_event.record_number } - let(:mock_exception) { double("Exception", {message: rand, backtrace:[rand, rand]})} + let(:mock_exception) { double("Exception", {message: rand, backtrace: [rand, rand]})} it "is available" do expect(Chef::EventLoggers::WindowsEventLogger.available?).to be_truthy diff --git a/spec/functional/resource/directory_spec.rb b/spec/functional/resource/directory_spec.rb index 31447cb69d..0c1345d57f 100644 --- a/spec/functional/resource/directory_spec.rb +++ b/spec/functional/resource/directory_spec.rb @@ -33,7 +33,7 @@ describe Chef::Resource::Directory do end let(:resource) do - create_resource + create_resource end it_behaves_like "a directory resource" diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb index 416dba4233..ba02e44481 100644 --- a/spec/unit/application/knife_spec.rb +++ b/spec/unit/application/knife_spec.rb @@ -191,7 +191,7 @@ describe Chef::Application::Knife do end it "should load the environment from the CLI options" do - with_argv(*%W{noop knife command -E development}) do + with_argv(*%w{noop knife command -E development}) do expect(@knife).to receive(:exit).with(0) @knife.run end diff --git a/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb index c6170d4e01..700d7fa7ed 100644 --- a/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb @@ -32,7 +32,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do describe "when explaining a 403 error" do before do - @response_body = %Q({"error": [{"message": "gtfo"}]) + @response_body = %q({"error": [{"message": "gtfo"}]) @response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden") allow(@response).to receive(:body).and_return(@response_body) @exception = Net::HTTPServerException.new("(exception) forbidden", @response) diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb index fa200762cb..5912016577 100644 --- a/spec/unit/key_spec.rb +++ b/spec/unit/key_spec.rb @@ -231,7 +231,7 @@ EOS it "should include the expiration_date field when present" do new_key.expiration_date "2020-12-24T21:00:00Z" - expect(new_key.to_json).to include(%Q{"expiration_date":"2020-12-24T21:00:00Z"}) + expect(new_key.to_json).to include(%q{"expiration_date":"2020-12-24T21:00:00Z"}) end it "should not include the expiration_date if not present" do diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb index 669d715cfc..2400676b84 100644 --- a/spec/unit/provider/service/debian_service_spec.rb +++ b/spec/unit/provider/service/debian_service_spec.rb @@ -276,7 +276,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop context "when the service is enabled" do before do @current_resource.enabled(true) - @current_resource.priority(80) + @current_resource.priority(80) end context "and the service sets no priority" do |