Skip to content

Commit

Permalink
Solve Layout/DotPosition RuboCop cop offenses
Browse files Browse the repository at this point in the history
This cop checks the . position in multi-line method calls. There were 2
offences and they were autocorrected. closes openSUSE#150
  • Loading branch information
Atul9 committed Feb 21, 2018
1 parent c7936ec commit dc5de4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
9 changes: 0 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'trollolo.gemspec'

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Layout/DotPosition:
Exclude:
- 'spec/integration/create_burndown_spec.rb'
- 'spec/unit/trello_wrapper_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/create_burndown_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def compare_images_for_sprint(sprint_number, extra_args = [])

result = run_helper(@working_dir, sprint_number, extra_args)
expect(result).to exit_with_success('')
expect(File.join(@working_dir, "burndown-#{sprint_number}.png")).
to be_same_image_as("create_burndown_helper/burndown-#{sprint_number}.png")
expect(File.join(@working_dir, "burndown-#{sprint_number}.png"))
.to be_same_image_as("create_burndown_helper/burndown-#{sprint_number}.png")
end

describe 'create_burndown.py' do
Expand Down
24 changes: 12 additions & 12 deletions spec/unit/trello_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
subject { described_class.new(settings) }

before do
stub_request(:get, 'https://api.trello.com/1/boards/myboard?cards=open&key=mykey&lists=open&token=mytoken').
to_return(status: 200, body: load_test_file('board.json'), headers: {})
stub_request(:get, 'https://api.trello.com/1/boards/myboard?cards=open&key=mykey&lists=open&token=mytoken')
.to_return(status: 200, body: load_test_file('board.json'), headers: {})
full_board_mock
end

Expand Down Expand Up @@ -80,18 +80,18 @@
}
EOT

stub_request(:get, 'https://api.trello.com/1/cards/123?key=mykey&token=mytoken').
with(headers: {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'}).
to_return(status: 200, body: card_body, headers: {})
stub_request(:get, 'https://api.trello.com/1/cards/123?key=mykey&token=mytoken')
.with(headers: {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'})
.to_return(status: 200, body: card_body, headers: {})

headers = {'Accept' => '*/*; q=0.5, application/xml',
'Accept-Encoding' => 'gzip, deflate',
'Content-Length' => '188',
'Content-Type' => 'multipart/form-data; boundary=470924',
'User-Agent' => 'Ruby'}

stub_request(:post, 'https://api.trello.com/1/cards/123/attachments?key=mykey&token=mytoken').
with(headers: headers).to_return(status: 200, body: '', headers: {})
stub_request(:post, 'https://api.trello.com/1/cards/123/attachments?key=mykey&token=mytoken')
.with(headers: headers).to_return(status: 200, body: '', headers: {})

path = given_file('attachment-data')

Expand Down Expand Up @@ -119,17 +119,17 @@
end

before(:each) do
stub_request(:get, "https://api.trello.com/1/cards/#{card_id}/attachments?fields=name&key=mykey&token=mytoken").
with(headers: {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'}).
to_return(status: 200, body: card_attachments_body, headers: {})
stub_request(:get, "https://api.trello.com/1/cards/#{card_id}/attachments?fields=name&key=mykey&token=mytoken")
.with(headers: {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'})
.to_return(status: 200, body: card_attachments_body, headers: {})
headers = {'Accept' => '*/*; q=0.5, application/xml',
'Accept-Encoding' => 'gzip, deflate',
'Content-Length' => '0',
'Content-Type' => 'application/x-www-form-urlencoded',
'User-Agent' => 'Ruby'}

stub_request(:put, "https://api.trello.com/1/cards/#{card_id}/idAttachmentCover?key=mykey&token=mytoken&value=#{image_id}").
with(headers: headers)
stub_request(:put, "https://api.trello.com/1/cards/#{card_id}/idAttachmentCover?key=mykey&token=mytoken&value=#{image_id}")
.with(headers: headers)
end

it 'make the attachment with the file name passed.jpg the cover' do
Expand Down

0 comments on commit dc5de4f

Please sign in to comment.