From 80601044ca17435c4936e462a45b996eb15757f1 Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Sat, 31 Oct 2015 15:22:24 +0100 Subject: [PATCH] Rubocop: remove leading and trailing space within parenthesis --- .rubocop_todo.yml | 12 ------------ spec/controllers/api/v1/problems_controller_spec.rb | 4 ++-- spec/controllers/comments_controller_spec.rb | 4 ++-- spec/controllers/problems_controller_spec.rb | 6 +++--- spec/interactors/problem_merge_spec.rb | 4 ++-- spec/mailers/mailer_spec.rb | 4 ++-- spec/models/notice_observer_spec.rb | 2 +- spec/models/notice_spec.rb | 2 +- 8 files changed, 13 insertions(+), 25 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3e1baae..1f77d9e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -354,18 +354,6 @@ Style/SpaceInsideBrackets: Style/SpaceInsideHashLiteralBraces: Enabled: false -# Offense count: 23 -# Cop supports --auto-correct. -Style/SpaceInsideParens: - Exclude: - - 'spec/controllers/api/v1/problems_controller_spec.rb' - - 'spec/controllers/comments_controller_spec.rb' - - 'spec/controllers/problems_controller_spec.rb' - - 'spec/interactors/problem_merge_spec.rb' - - 'spec/mailers/mailer_spec.rb' - - 'spec/models/notice_observer_spec.rb' - - 'spec/models/notice_spec.rb' - # Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/spec/controllers/api/v1/problems_controller_spec.rb b/spec/controllers/api/v1/problems_controller_spec.rb index f996230..62d5e89 100644 --- a/spec/controllers/api/v1/problems_controller_spec.rb +++ b/spec/controllers/api/v1/problems_controller_spec.rb @@ -37,7 +37,7 @@ describe Api::V1::ProblemsController, type: 'controller' do get :show, :auth_token => @user.authentication_token, :format => "json", :id => @problem.id returned_problem = JSON.parse(response.body) - expect( returned_problem.keys ).to match_array(%w( + expect(returned_problem.keys).to match_array(%w( app_name first_notice_at message @@ -53,7 +53,7 @@ describe Api::V1::ProblemsController, type: 'controller' do it "returns a 404 if the problem cannot be found" do get :show, :auth_token => @user.authentication_token, :format => "json", :id => 'IdontExist' - expect( response.status ).to eq(404) + expect(response.status).to eq(404) end end diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 3ee17e8..0a2afbe 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -24,7 +24,7 @@ describe CommentsController, type: 'controller' do end it "should redirect to problem page" do - expect(response).to redirect_to( app_problem_path(problem.app, problem) ) + expect(response).to redirect_to(app_problem_path(problem.app, problem)) end end end @@ -50,7 +50,7 @@ describe CommentsController, type: 'controller' do end it "should redirect to problem page" do - expect(response).to redirect_to( app_problem_path(problem.app, problem) ) + expect(response).to redirect_to(app_problem_path(problem.app, problem)) end end end diff --git a/spec/controllers/problems_controller_spec.rb b/spec/controllers/problems_controller_spec.rb index 9d0b188..cbe8534 100644 --- a/spec/controllers/problems_controller_spec.rb +++ b/spec/controllers/problems_controller_spec.rb @@ -256,7 +256,7 @@ describe ProblemsController, type: 'controller' do context "when app has no issue tracker" do it "should redirect to problem page" do post :create_issue, app_id: problem.app.id, id: problem.id - expect(response).to redirect_to( app_problem_path(problem.app, problem) ) + expect(response).to redirect_to(app_problem_path(problem.app, problem)) expect(flash[:error]).to eql "This app has no issue tracker" end end @@ -276,7 +276,7 @@ describe ProblemsController, type: 'controller' do end it "should redirect to problem page" do - expect(response).to redirect_to( app_problem_path(err.app, err.problem) ) + expect(response).to redirect_to(app_problem_path(err.app, err.problem)) end it "should clear issue link" do @@ -293,7 +293,7 @@ describe ProblemsController, type: 'controller' do end it "should redirect to problem page" do - expect(response).to redirect_to( app_problem_path(err.app, err.problem) ) + expect(response).to redirect_to(app_problem_path(err.app, err.problem)) end end end diff --git a/spec/interactors/problem_merge_spec.rb b/spec/interactors/problem_merge_spec.rb index 106cecd..372e6f3 100644 --- a/spec/interactors/problem_merge_spec.rb +++ b/spec/interactors/problem_merge_spec.rb @@ -52,8 +52,8 @@ describe ProblemMerge do end context "with problem with comment" do - let!(:comment) { Fabricate(:comment, :err => problem ) } - let!(:comment_2) { Fabricate(:comment, :err => problem_1, :user => comment.user ) } + let!(:comment) { Fabricate(:comment, :err => problem) } + let!(:comment_2) { Fabricate(:comment, :err => problem_1, :user => comment.user) } it 'merge comment' do expect { problem_merge.merge diff --git a/spec/mailers/mailer_spec.rb b/spec/mailers/mailer_spec.rb index bb795bc..ce10d35 100644 --- a/spec/mailers/mailer_spec.rb +++ b/spec/mailers/mailer_spec.rb @@ -81,13 +81,13 @@ describe Mailer do end it "should have the error count in the subject" do - expect(email.subject).to match( /^\(3\) / ) + expect(email.subject).to match(/^\(3\) /) end context 'with a very long message' do let(:notice) { Fabricate(:notice, :message => 6.times.collect{|_a| "0123456789" }.join('')) } it "should truncate the long message" do - expect(email.subject).to match( / \d{47}\.{3}$/ ) + expect(email.subject).to match(/ \d{47}\.{3}$/) end end end diff --git a/spec/models/notice_observer_spec.rb b/spec/models/notice_observer_spec.rb index b210c07..6c3ea0b 100644 --- a/spec/models/notice_observer_spec.rb +++ b/spec/models/notice_observer_spec.rb @@ -130,7 +130,7 @@ describe "Callback on Notice", type: 'model' do describe 'should not send a notification if a notification service is not' \ 'configured' do let(:notification_service) { Fabricate(:notification_service) } - let(:app) { Fabricate(:app, notification_service: notification_service )} + let(:app) { Fabricate(:app, notification_service: notification_service)} let(:notice_attrs) { notice_attrs_for.call(app.api_key) } before { Errbit::Config.per_app_notify_at_notices = true } diff --git a/spec/models/notice_spec.rb b/spec/models/notice_spec.rb index 6d40e2d..ef87d0c 100644 --- a/spec/models/notice_spec.rb +++ b/spec/models/notice_spec.rb @@ -61,7 +61,7 @@ describe Notice, type: 'model' do 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16' }}) expect(notice.user_agent.browser).to eq 'Chrome' - expect(notice.user_agent.version.to_s).to match( /^10\.0/ ) + expect(notice.user_agent.version.to_s).to match(/^10\.0/) end it "should be nil if HTTP_USER_AGENT is blank" do -- libgit2 0.21.2