Skip to content

Commit d9a145e

Browse files
committed
Fix Style/HashSyntax offenses
1 parent 4fefa5e commit d9a145e

File tree

7 files changed

+49
-49
lines changed

7 files changed

+49
-49
lines changed

lib/mailtrap/client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def initialize( # rubocop:disable Metrics/ParameterLists
3535
raise ArgumentError, 'api_key is required' if api_key.nil?
3636
raise ArgumentError, 'api_port is required' if api_port.nil?
3737

38-
api_host ||= select_api_host(bulk: bulk, sandbox: sandbox)
38+
api_host ||= select_api_host(bulk:, sandbox:)
3939
raise ArgumentError, 'inbox_id is required for sandbox API' if sandbox && inbox_id.nil?
4040

4141
@api_key = api_key

lib/mailtrap/mail/base.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def attachments=(attachments)
6767

6868
def add_attachment(content:, filename:, type: nil, disposition: nil, content_id: nil)
6969
attachment = Mailtrap::Attachment.new(
70-
content: content,
71-
filename: filename,
72-
type: type,
73-
disposition: disposition,
74-
content_id: content_id
70+
content:,
71+
filename:,
72+
type:,
73+
disposition:,
74+
content_id:
7575
)
7676
attachments << attachment
7777

lib/mailtrap/mail/from_template.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ def initialize( # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
1818
template_variables: {}
1919
)
2020
super(
21-
from: from,
22-
to: to,
23-
reply_to: reply_to,
24-
cc: cc,
25-
bcc: bcc,
26-
attachments: attachments,
27-
headers: headers,
28-
custom_variables: custom_variables
21+
from:,
22+
to:,
23+
reply_to:,
24+
cc:,
25+
bcc:,
26+
attachments:,
27+
headers:,
28+
custom_variables:
2929
)
3030
@template_uuid = template_uuid
3131
@template_variables = template_variables

spec/mailtrap/attachment_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
RSpec.describe Mailtrap::Attachment do
77
subject(:attachment) do
88
described_class.new(
9-
content: content,
10-
filename: filename,
11-
type: type,
12-
disposition: disposition,
13-
content_id: content_id
9+
content:,
10+
filename:,
11+
type:,
12+
disposition:,
13+
content_id:
1414
)
1515
end
1616

spec/mailtrap/client_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Mailtrap::Client do
4-
subject(:client) { described_class.new(api_key: api_key) }
4+
subject(:client) { described_class.new(api_key:) }
55

66
let(:api_key) { 'correct-api-key' }
77

@@ -65,7 +65,7 @@
6565

6666
context 'with an alternative host' do
6767
let(:client) do
68-
described_class.new(api_key: api_key, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
68+
described_class.new(api_key:, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
6969
end
7070

7171
it 'sending is successful' do
@@ -75,7 +75,7 @@
7575

7676
context 'with bulk flag' do
7777
let(:client) do
78-
described_class.new(api_key: api_key, bulk: true)
78+
described_class.new(api_key:, bulk: true)
7979
end
8080

8181
it 'chooses host for bulk sending' do
@@ -85,7 +85,7 @@
8585

8686
context 'with bulk flag and alternative host' do
8787
let(:client) do
88-
described_class.new(api_key: api_key, bulk: true, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
88+
described_class.new(api_key:, bulk: true, api_host: 'alternative.host.mailtrap.io', api_port: 8080)
8989
end
9090

9191
it 'chooses alternative host' do
@@ -95,7 +95,7 @@
9595

9696
context 'with sandbox flag' do
9797
let(:client) do
98-
described_class.new(api_key: api_key, sandbox: true, inbox_id: 12)
98+
described_class.new(api_key:, sandbox: true, inbox_id: 12)
9999
end
100100

101101
it 'chooses host for sandbox sending' do
@@ -105,15 +105,15 @@
105105

106106
context 'with sandbox flag without inbox id' do
107107
let(:client) do
108-
described_class.new(api_key: api_key, sandbox: true)
108+
described_class.new(api_key:, sandbox: true)
109109
end
110110

111111
it { expect { send }.to raise_error(ArgumentError, 'inbox_id is required for sandbox API') }
112112
end
113113

114114
context 'with bulk and sandbox flag' do
115115
let(:client) do
116-
described_class.new(api_key: api_key, bulk: true, sandbox: true)
116+
described_class.new(api_key:, bulk: true, sandbox: true)
117117
end
118118

119119
it { expect { send }.to raise_error(ArgumentError, 'bulk mode is not applicable for sandbox API') }
@@ -155,7 +155,7 @@
155155

156156
context 'when using sandbox' do
157157
let(:client) do
158-
described_class.new(api_key: api_key, sandbox: true, inbox_id: 13)
158+
described_class.new(api_key:, sandbox: true, inbox_id: 13)
159159
end
160160

161161
it 'sending is successful' do
@@ -178,7 +178,7 @@
178178
end
179179

180180
def stub_api_send(status, body = nil)
181-
stub = stub_request(:post, %r{/api/send}).to_return(status: status, body: body)
181+
stub = stub_request(:post, %r{/api/send}).to_return(status:, body:)
182182
yield
183183
expect(stub).to have_been_requested
184184
end

spec/mailtrap/mail/base_spec.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
RSpec.describe Mailtrap::Mail::Base do
77
subject(:mail) do
88
described_class.new(
9-
from: from,
10-
to: to,
11-
reply_to: reply_to,
12-
cc: cc,
13-
bcc: bcc,
9+
from:,
10+
to:,
11+
reply_to:,
12+
cc:,
13+
bcc:,
1414
subject: mail_subject,
15-
text: text,
16-
html: html,
17-
attachments: attachments,
18-
headers: headers,
19-
category: category,
20-
custom_variables: custom_variables
15+
text:,
16+
html:,
17+
attachments:,
18+
headers:,
19+
category:,
20+
custom_variables:
2121
)
2222
end
2323

spec/mailtrap/mail/from_template_spec.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
RSpec.describe Mailtrap::Mail::FromTemplate do
77
subject(:mail) do
88
described_class.new(
9-
from: from,
10-
to: to,
11-
reply_to: reply_to,
12-
cc: cc,
13-
bcc: bcc,
14-
attachments: attachments,
15-
headers: headers,
16-
custom_variables: custom_variables,
17-
template_uuid: template_uuid,
18-
template_variables: template_variables
9+
from:,
10+
to:,
11+
reply_to:,
12+
cc:,
13+
bcc:,
14+
attachments:,
15+
headers:,
16+
custom_variables:,
17+
template_uuid:,
18+
template_variables:
1919
)
2020
end
2121

0 commit comments

Comments
 (0)