Skip to content

Commit b49ec66

Browse files
committed
Fix Rubocop offences
1 parent b313ce2 commit b49ec66

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/octokit/connection.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ def parse_query_and_convenience_headers(options)
209209

210210
def response_data_correctly_encoded(response)
211211
# TODO: I'm guessing base64 content responses are still broken, but this fixes the bug we're running into
212-
content_type= response.headers.fetch("content-type", "")
213-
return response.data unless content_type.include?("charset") && response.data.is_a?(String)
212+
content_type = response.headers.fetch('content-type', '')
213+
return response.data unless content_type.include?('charset') && response.data.is_a?(String)
214214

215215
reported_encoding = content_type.match(/charset=([^ ]+)/)[1]
216216
response.data.force_encoding(reported_encoding)

spec/octokit/client/contents_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
assert_requested :get, github_url('/repos/octokit/octokit.rb/contents/lib/octokit.rb')
2727
end
2828

29-
it "returns the contents of a file properly encoded as specified by the response headers" do
30-
contents = @client.contents("octokit/octokit.rb", :path => "spec/fixtures/utf8.en.js", accept: "application/vnd.github.V3.raw")
31-
expect(contents).to eq(File.read("spec/fixtures/utf8.en.js"))
29+
it 'returns the contents of a file properly encoded as specified by the response headers' do
30+
contents = @client.contents('octokit/octokit.rb', path: 'spec/fixtures/utf8.en.js', accept: 'application/vnd.github.V3.raw')
31+
expect(contents).to eq(File.read('spec/fixtures/utf8.en.js'))
3232
expect(contents.encoding).to eq(Encoding::UTF_8)
33-
assert_requested :get, github_url("/repos/octokit/octokit.rb/contents/spec/fixtures/utf8.en.js")
33+
assert_requested :get, github_url('/repos/octokit/octokit.rb/contents/spec/fixtures/utf8.en.js')
3434
end
3535
end # .contents
3636

0 commit comments

Comments
 (0)