Zfilipin has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/168277

Change subject: Fixed Style/BracesAroundHashParameters RuboCop offense
......................................................................

Fixed Style/BracesAroundHashParameters RuboCop offense

Bug: 63307
Change-Id: I8493db95b21496d0c94a771856885554104fa7a1
---
M .rubocop_todo.yml
M lib/mediawiki_api/client.rb
M spec/client_spec.rb
3 files changed, 9 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/ruby/api 
refs/changes/77/168277/1

diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index fee2ad7..6e29d00 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -33,12 +33,6 @@
 Style/Alias:
   Enabled: false
 
-# Offense count: 9
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/BracesAroundHashParameters:
-  Enabled: false
-
 # Offense count: 1
 # Configuration parameters: EnforcedStyle, SupportedStyles.
 Style/ClassAndModuleChildren:
diff --git a/lib/mediawiki_api/client.rb b/lib/mediawiki_api/client.rb
index 03784d9..2758cbc 100644
--- a/lib/mediawiki_api/client.rb
+++ b/lib/mediawiki_api/client.rb
@@ -80,7 +80,7 @@
     end
 
     def get_wikitext(title)
-      @conn.get "/w/index.php", { action: "raw", title: title }
+      @conn.get "/w/index.php", action: "raw", title: title
     end
 
     def list(type, params = {})
diff --git a/spec/client_spec.rb b/spec/client_spec.rb
index 760e830..4787347 100644
--- a/spec/client_spec.rb
+++ b/spec/client_spec.rb
@@ -150,7 +150,7 @@
     it "logs in when API returns Success" do
       stub_request(:post, api_url).
         with(body: { format: "json", action: "login", lgname: "Test", 
lgpassword: "qwe123" }).
-        to_return(body: { login: body_base.merge({ result: "Success" }) 
}.to_json )
+        to_return(body: { login: body_base.merge(result: "Success") }.to_json )
 
       subject.log_in "Test", "qwe123"
       expect(subject.logged_in).to be true
@@ -163,14 +163,14 @@
         stub_request(:post, api_url).
           with(body: { format: "json", action: "login", lgname: "Test", 
lgpassword: "qwe123" }).
           to_return(
-            body: { login: body_base.merge({ result: "NeedToken", token: "456" 
}) }.to_json,
+            body: { login: body_base.merge(result: "NeedToken", token: "456") 
}.to_json,
             headers: { "Set-Cookie" => "prefixSession=789; path=/; 
domain=localhost; HttpOnly" }
           )
 
         @success_req = stub_request(:post, api_url).
           with(body: { format: "json", action: "login", lgname: "Test", 
lgpassword: "qwe123", lgtoken: "456" }).
           with(headers: { "Cookie" => "prefixSession=789" }).
-          to_return(body: { login: body_base.merge({ result: "Success" }) 
}.to_json )
+          to_return(body: { login: body_base.merge(result: "Success") 
}.to_json )
       end
 
       it "logs in" do
@@ -191,7 +191,7 @@
       before do
         stub_request(:post, api_url).
           with(body: { format: "json", action: "login", lgname: "Test", 
lgpassword: "qwe123" }).
-          to_return(body: { login: body_base.merge({ result: "EmptyPass" }) 
}.to_json )
+          to_return(body: { login: body_base.merge(result: "EmptyPass") 
}.to_json )
       end
 
       it "does not log in" do
@@ -281,7 +281,7 @@
     it "creates an account when API returns Success" do
       stub_request(:post, api_url).
         with(body: { format: "json", action: "createaccount", name: "Test", 
password: "qwe123" }).
-        to_return(body: { createaccount: body_base.merge({ result: "Success" 
}) }.to_json )
+        to_return(body: { createaccount: body_base.merge(result: "Success") 
}.to_json )
 
       expect(subject.create_account("Test", "qwe123")).to include("result" => 
"Success")
     end
@@ -293,14 +293,14 @@
         stub_request(:post, api_url).
           with(body: { format: "json", action: "createaccount", name: "Test", 
password: "qwe123" }).
           to_return(
-            body: { createaccount: body_base.merge({ result: "NeedToken", 
token: "456" }) }.to_json,
+            body: { createaccount: body_base.merge(result: "NeedToken", token: 
"456") }.to_json,
             headers: { "Set-Cookie" => "prefixSession=789; path=/; 
domain=localhost; HttpOnly" }
           )
 
         @success_req = stub_request(:post, api_url).
           with(body: { format: "json", action: "createaccount", name: "Test", 
password: "qwe123", token: "456" }).
           with(headers: { "Cookie" => "prefixSession=789" }).
-          to_return(body: { createaccount: body_base.merge({ result: "Success" 
}) }.to_json )
+          to_return(body: { createaccount: body_base.merge(result: "Success") 
}.to_json )
       end
 
       it "creates an account" do
@@ -319,7 +319,7 @@
       before do
         stub_request(:post, api_url).
           with(body: { format: "json", action: "createaccount", name: "Test", 
password: "qwe123" }).
-          to_return(body: { createaccount: body_base.merge({ result: 
"WhoKnows" }) }.to_json )
+          to_return(body: { createaccount: body_base.merge(result: "WhoKnows") 
}.to_json )
       end
 
       it "raises error with proper message" do

-- 
To view, visit https://gerrit.wikimedia.org/r/168277
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8493db95b21496d0c94a771856885554104fa7a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/ruby/api
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <zfili...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to