dnsimple 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_dnsimple.yml +128 -74
- data/.travis.yml +2 -2
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/dnsimple.gemspec +2 -2
- data/lib/dnsimple/client/certificates.rb +24 -0
- data/lib/dnsimple/client/registrar.rb +4 -4
- data/lib/dnsimple/version.rb +1 -1
- data/spec/dnsimple/client/accounts_spec.rb +4 -4
- data/spec/dnsimple/client/certificates_spec.rb +43 -22
- data/spec/dnsimple/client/client_service_spec.rb +6 -6
- data/spec/dnsimple/client/collaborators_spec.rb +20 -20
- data/spec/dnsimple/client/contacts_spec.rb +30 -30
- data/spec/dnsimple/client/domains_delegation_signer_records_spec.rb +25 -25
- data/spec/dnsimple/client/domains_dnssec_spec.rb +18 -18
- data/spec/dnsimple/client/domains_email_forwards_spec.rb +25 -25
- data/spec/dnsimple/client/domains_pushes_spec.rb +22 -22
- data/spec/dnsimple/client/domains_spec.rb +27 -27
- data/spec/dnsimple/client/identity_spec.rb +8 -8
- data/spec/dnsimple/client/oauth_spec.rb +8 -8
- data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +12 -12
- data/spec/dnsimple/client/registrar_delegation_spec.rb +18 -18
- data/spec/dnsimple/client/registrar_spec.rb +37 -37
- data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +16 -16
- data/spec/dnsimple/client/services_domains_spec.rb +13 -13
- data/spec/dnsimple/client/services_spec.rb +10 -10
- data/spec/dnsimple/client/templates_domains_spec.rb +4 -4
- data/spec/dnsimple/client/templates_records_spec.rb +25 -25
- data/spec/dnsimple/client/templates_spec.rb +26 -26
- data/spec/dnsimple/client/tlds_spec.rb +16 -16
- data/spec/dnsimple/client/vanity_name_servers_spec.rb +8 -8
- data/spec/dnsimple/client/webhooks_spec.rb +21 -21
- data/spec/dnsimple/client/zones_records_spec.rb +40 -40
- data/spec/dnsimple/client/zones_spec.rb +18 -18
- data/spec/dnsimple/client_spec.rb +25 -25
- metadata +3 -5
@@ -10,15 +10,15 @@ describe Dnsimple::Client, ".zones" do
|
|
10
10
|
let(:zone_id) { "example.com" }
|
11
11
|
|
12
12
|
before do
|
13
|
-
stub_request(:get, %r{/v2/#{account_id}/zones/#{zone_id}/records})
|
14
|
-
to_return(read_http_fixture("listZoneRecords/success.http"))
|
13
|
+
stub_request(:get, %r{/v2/#{account_id}/zones/#{zone_id}/records})
|
14
|
+
.to_return(read_http_fixture("listZoneRecords/success.http"))
|
15
15
|
end
|
16
16
|
|
17
17
|
it "builds the correct request" do
|
18
18
|
subject.records(account_id, zone_id)
|
19
19
|
|
20
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records")
|
21
|
-
with(headers: { 'Accept' => 'application/json' })
|
20
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records")
|
21
|
+
.with(headers: { 'Accept' => 'application/json' })
|
22
22
|
end
|
23
23
|
|
24
24
|
it "supports pagination" do
|
@@ -71,8 +71,8 @@ describe Dnsimple::Client, ".zones" do
|
|
71
71
|
|
72
72
|
context "when the zone does not exist" do
|
73
73
|
it "raises NotFoundError" do
|
74
|
-
stub_request(:get, %r{/v2})
|
75
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
74
|
+
stub_request(:get, %r{/v2})
|
75
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
76
76
|
|
77
77
|
expect {
|
78
78
|
subject.records(account_id, zone_id)
|
@@ -83,8 +83,8 @@ describe Dnsimple::Client, ".zones" do
|
|
83
83
|
|
84
84
|
describe "#all_records" do
|
85
85
|
before do
|
86
|
-
stub_request(:get, %r{/v2/#{account_id}/zones/#{zone_id}/records})
|
87
|
-
to_return(read_http_fixture("listZoneRecords/success.http"))
|
86
|
+
stub_request(:get, %r{/v2/#{account_id}/zones/#{zone_id}/records})
|
87
|
+
.to_return(read_http_fixture("listZoneRecords/success.http"))
|
88
88
|
end
|
89
89
|
|
90
90
|
let(:account_id) { 1010 }
|
@@ -113,8 +113,8 @@ describe Dnsimple::Client, ".zones" do
|
|
113
113
|
let(:zone_id) { "example.com" }
|
114
114
|
|
115
115
|
before do
|
116
|
-
stub_request(:post, %r{/v2/#{account_id}/zones/#{zone_id}/records$})
|
117
|
-
to_return(read_http_fixture("createZoneRecord/created.http"))
|
116
|
+
stub_request(:post, %r{/v2/#{account_id}/zones/#{zone_id}/records$})
|
117
|
+
.to_return(read_http_fixture("createZoneRecord/created.http"))
|
118
118
|
end
|
119
119
|
|
120
120
|
let(:attributes) { { type: "A", name: "www", content: "127.0.0.1", regions: %w(global) } }
|
@@ -122,9 +122,9 @@ describe Dnsimple::Client, ".zones" do
|
|
122
122
|
it "builds the correct request" do
|
123
123
|
subject.create_record(account_id, zone_id, attributes)
|
124
124
|
|
125
|
-
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records")
|
126
|
-
with(body: attributes)
|
127
|
-
with(headers: { 'Accept' => 'application/json' })
|
125
|
+
expect(WebMock).to have_requested(:post, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records")
|
126
|
+
.with(body: attributes)
|
127
|
+
.with(headers: { 'Accept' => 'application/json' })
|
128
128
|
end
|
129
129
|
|
130
130
|
it "returns the record" do
|
@@ -142,8 +142,8 @@ describe Dnsimple::Client, ".zones" do
|
|
142
142
|
|
143
143
|
context "when the zone does not exist" do
|
144
144
|
it "raises NotFoundError" do
|
145
|
-
stub_request(:post, %r{/v2})
|
146
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
145
|
+
stub_request(:post, %r{/v2})
|
146
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
147
147
|
|
148
148
|
expect {
|
149
149
|
subject.create_record(account_id, zone_id, attributes)
|
@@ -158,15 +158,15 @@ describe Dnsimple::Client, ".zones" do
|
|
158
158
|
let(:record_id) { 5 }
|
159
159
|
|
160
160
|
before do
|
161
|
-
stub_request(:get, %r{/v2/#{account_id}/zones/#{zone_id}/records/.+$})
|
162
|
-
to_return(read_http_fixture("getZoneRecord/success.http"))
|
161
|
+
stub_request(:get, %r{/v2/#{account_id}/zones/#{zone_id}/records/.+$})
|
162
|
+
.to_return(read_http_fixture("getZoneRecord/success.http"))
|
163
163
|
end
|
164
164
|
|
165
165
|
it "builds the correct request" do
|
166
166
|
subject.record(account_id, zone_id, record_id)
|
167
167
|
|
168
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
|
169
|
-
with(headers: { 'Accept' => 'application/json' })
|
168
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
|
169
|
+
.with(headers: { 'Accept' => 'application/json' })
|
170
170
|
end
|
171
171
|
|
172
172
|
it "returns the record" do
|
@@ -191,8 +191,8 @@ describe Dnsimple::Client, ".zones" do
|
|
191
191
|
|
192
192
|
context "when the zone does not exist" do
|
193
193
|
it "raises NotFoundError" do
|
194
|
-
stub_request(:get, %r{/v2})
|
195
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
194
|
+
stub_request(:get, %r{/v2})
|
195
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
196
196
|
|
197
197
|
expect {
|
198
198
|
subject.record(account_id, zone_id, "0")
|
@@ -202,8 +202,8 @@ describe Dnsimple::Client, ".zones" do
|
|
202
202
|
|
203
203
|
context "when the record does not exist" do
|
204
204
|
it "raises NotFoundError" do
|
205
|
-
stub_request(:get, %r{/v2})
|
206
|
-
to_return(read_http_fixture("notfound-record.http"))
|
205
|
+
stub_request(:get, %r{/v2})
|
206
|
+
.to_return(read_http_fixture("notfound-record.http"))
|
207
207
|
|
208
208
|
expect {
|
209
209
|
subject.record(account_id, zone_id, "0")
|
@@ -218,8 +218,8 @@ describe Dnsimple::Client, ".zones" do
|
|
218
218
|
let(:record_id) { 5 }
|
219
219
|
|
220
220
|
before do
|
221
|
-
stub_request(:patch, %r{/v2/#{account_id}/zones/#{zone_id}/records/.+$})
|
222
|
-
to_return(read_http_fixture("updateZoneRecord/success.http"))
|
221
|
+
stub_request(:patch, %r{/v2/#{account_id}/zones/#{zone_id}/records/.+$})
|
222
|
+
.to_return(read_http_fixture("updateZoneRecord/success.http"))
|
223
223
|
end
|
224
224
|
|
225
225
|
let(:attributes) { { content: "mxb.example.com", priority: "20", regions: ['global'] } }
|
@@ -227,9 +227,9 @@ describe Dnsimple::Client, ".zones" do
|
|
227
227
|
it "builds the correct request" do
|
228
228
|
subject.update_record(account_id, zone_id, record_id, attributes)
|
229
229
|
|
230
|
-
expect(WebMock).to have_requested(:patch, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
|
231
|
-
with(body: attributes)
|
232
|
-
with(headers: { 'Accept' => 'application/json' })
|
230
|
+
expect(WebMock).to have_requested(:patch, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
|
231
|
+
.with(body: attributes)
|
232
|
+
.with(headers: { 'Accept' => 'application/json' })
|
233
233
|
end
|
234
234
|
|
235
235
|
it "returns the record" do
|
@@ -246,8 +246,8 @@ describe Dnsimple::Client, ".zones" do
|
|
246
246
|
|
247
247
|
context "when the zone does not exist" do
|
248
248
|
it "raises NotFoundError" do
|
249
|
-
stub_request(:patch, %r{/v2})
|
250
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
249
|
+
stub_request(:patch, %r{/v2})
|
250
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
251
251
|
|
252
252
|
expect {
|
253
253
|
subject.update_record(account_id, zone_id, "0", {})
|
@@ -257,8 +257,8 @@ describe Dnsimple::Client, ".zones" do
|
|
257
257
|
|
258
258
|
context "when the record does not exist" do
|
259
259
|
it "raises NotFoundError" do
|
260
|
-
stub_request(:patch, %r{/v2})
|
261
|
-
to_return(read_http_fixture("notfound-record.http"))
|
260
|
+
stub_request(:patch, %r{/v2})
|
261
|
+
.to_return(read_http_fixture("notfound-record.http"))
|
262
262
|
|
263
263
|
expect {
|
264
264
|
subject.update_record(account_id, zone_id, "0", {})
|
@@ -272,15 +272,15 @@ describe Dnsimple::Client, ".zones" do
|
|
272
272
|
let(:zone_id) { "example.com" }
|
273
273
|
|
274
274
|
before do
|
275
|
-
stub_request(:delete, %r{/v2/#{account_id}/zones/#{zone_id}/records/.+$})
|
276
|
-
to_return(read_http_fixture("deleteZoneRecord/success.http"))
|
275
|
+
stub_request(:delete, %r{/v2/#{account_id}/zones/#{zone_id}/records/.+$})
|
276
|
+
.to_return(read_http_fixture("deleteZoneRecord/success.http"))
|
277
277
|
end
|
278
278
|
|
279
279
|
it "builds the correct request" do
|
280
280
|
subject.delete_record(account_id, zone_id, record_id = 2)
|
281
281
|
|
282
|
-
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
|
283
|
-
with(headers: { 'Accept' => 'application/json' })
|
282
|
+
expect(WebMock).to have_requested(:delete, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone_id}/records/#{record_id}")
|
283
|
+
.with(headers: { 'Accept' => 'application/json' })
|
284
284
|
end
|
285
285
|
|
286
286
|
it "returns nothing" do
|
@@ -293,8 +293,8 @@ describe Dnsimple::Client, ".zones" do
|
|
293
293
|
|
294
294
|
context "when the zone does not exist" do
|
295
295
|
it "raises NotFoundError" do
|
296
|
-
stub_request(:delete, %r{/v2})
|
297
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
296
|
+
stub_request(:delete, %r{/v2})
|
297
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
298
298
|
|
299
299
|
expect {
|
300
300
|
subject.delete_record(account_id, zone_id, "0")
|
@@ -304,8 +304,8 @@ describe Dnsimple::Client, ".zones" do
|
|
304
304
|
|
305
305
|
context "when the record does not exist" do
|
306
306
|
it "raises NotFoundError" do
|
307
|
-
stub_request(:delete, %r{/v2})
|
308
|
-
to_return(read_http_fixture("notfound-record.http"))
|
307
|
+
stub_request(:delete, %r{/v2})
|
308
|
+
.to_return(read_http_fixture("notfound-record.http"))
|
309
309
|
|
310
310
|
expect {
|
311
311
|
subject.delete_record(account_id, zone_id, "0")
|
@@ -9,15 +9,15 @@ describe Dnsimple::Client, ".zones" do
|
|
9
9
|
let(:account_id) { 1010 }
|
10
10
|
|
11
11
|
before do
|
12
|
-
stub_request(:get, %r{/v2/#{account_id}/zones})
|
13
|
-
to_return(read_http_fixture("listZones/success.http"))
|
12
|
+
stub_request(:get, %r{/v2/#{account_id}/zones})
|
13
|
+
.to_return(read_http_fixture("listZones/success.http"))
|
14
14
|
end
|
15
15
|
|
16
16
|
it "builds the correct request" do
|
17
17
|
subject.zones(account_id)
|
18
18
|
|
19
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones")
|
20
|
-
with(headers: { 'Accept' => 'application/json' })
|
19
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones")
|
20
|
+
.with(headers: { 'Accept' => 'application/json' })
|
21
21
|
end
|
22
22
|
|
23
23
|
it "supports pagination" do
|
@@ -70,8 +70,8 @@ describe Dnsimple::Client, ".zones" do
|
|
70
70
|
|
71
71
|
describe "#all_zones" do
|
72
72
|
before do
|
73
|
-
stub_request(:get, %r{/v2/#{account_id}/zones})
|
74
|
-
to_return(read_http_fixture("listZones/success.http"))
|
73
|
+
stub_request(:get, %r{/v2/#{account_id}/zones})
|
74
|
+
.to_return(read_http_fixture("listZones/success.http"))
|
75
75
|
end
|
76
76
|
|
77
77
|
let(:account_id) { 1010 }
|
@@ -98,15 +98,15 @@ describe Dnsimple::Client, ".zones" do
|
|
98
98
|
let(:account_id) { 1010 }
|
99
99
|
|
100
100
|
before do
|
101
|
-
stub_request(:get, %r{/v2/#{account_id}/zones/.+$})
|
102
|
-
to_return(read_http_fixture("getZone/success.http"))
|
101
|
+
stub_request(:get, %r{/v2/#{account_id}/zones/.+$})
|
102
|
+
.to_return(read_http_fixture("getZone/success.http"))
|
103
103
|
end
|
104
104
|
|
105
105
|
it "builds the correct request" do
|
106
106
|
subject.zone(account_id, zone = "example.com")
|
107
107
|
|
108
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}")
|
109
|
-
with(headers: { 'Accept' => 'application/json' })
|
108
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}")
|
109
|
+
.with(headers: { 'Accept' => 'application/json' })
|
110
110
|
end
|
111
111
|
|
112
112
|
it "returns the zone" do
|
@@ -125,8 +125,8 @@ describe Dnsimple::Client, ".zones" do
|
|
125
125
|
|
126
126
|
context "when the zone does not exist" do
|
127
127
|
it "raises NotFoundError" do
|
128
|
-
stub_request(:get, %r{/v2})
|
129
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
128
|
+
stub_request(:get, %r{/v2})
|
129
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
130
130
|
|
131
131
|
expect {
|
132
132
|
subject.zone(account_id, "example.com")
|
@@ -139,15 +139,15 @@ describe Dnsimple::Client, ".zones" do
|
|
139
139
|
let(:account_id) { 1010 }
|
140
140
|
|
141
141
|
before do
|
142
|
-
stub_request(:get, %r{/v2/#{account_id}/zones/.+$})
|
143
|
-
to_return(read_http_fixture("getZoneFile/success.http"))
|
142
|
+
stub_request(:get, %r{/v2/#{account_id}/zones/.+$})
|
143
|
+
.to_return(read_http_fixture("getZoneFile/success.http"))
|
144
144
|
end
|
145
145
|
|
146
146
|
it "builds the correct request" do
|
147
147
|
subject.zone_file(account_id, zone = "example.com")
|
148
148
|
|
149
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}/file")
|
150
|
-
with(headers: { 'Accept' => 'application/json' })
|
149
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.test/v2/#{account_id}/zones/#{zone}/file")
|
150
|
+
.with(headers: { 'Accept' => 'application/json' })
|
151
151
|
end
|
152
152
|
|
153
153
|
it "returns the zone id" do
|
@@ -161,8 +161,8 @@ describe Dnsimple::Client, ".zones" do
|
|
161
161
|
|
162
162
|
context "when the zone file does not exist" do
|
163
163
|
it "raises NotFoundError" do
|
164
|
-
stub_request(:get, %r{/v2})
|
165
|
-
to_return(read_http_fixture("notfound-zone.http"))
|
164
|
+
stub_request(:get, %r{/v2})
|
165
|
+
.to_return(read_http_fixture("notfound-zone.http"))
|
166
166
|
|
167
167
|
expect {
|
168
168
|
subject.zone_file(account_id, "example.com")
|
@@ -40,8 +40,8 @@ describe Dnsimple::Client do
|
|
40
40
|
subject = described_class.new(access_token: "access-token")
|
41
41
|
subject.execute(:get, "test", {})
|
42
42
|
|
43
|
-
expect(WebMock).to
|
44
|
-
with { |req| req.headers["Authorization"] == "Bearer access-token" }
|
43
|
+
expect(WebMock).to(have_requested(:get, "https://api.dnsimple.com/test")
|
44
|
+
.with { |req| req.headers["Authorization"] == "Bearer access-token" })
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -116,78 +116,78 @@ describe Dnsimple::Client do
|
|
116
116
|
|
117
117
|
subject.request(:get, 'foo', {})
|
118
118
|
|
119
|
-
expect(WebMock).to have_requested(:get, "https://api.dnsimple.com/foo")
|
120
|
-
with(basic_auth: %w(user pass),
|
121
|
-
|
119
|
+
expect(WebMock).to have_requested(:get, "https://api.dnsimple.com/foo")
|
120
|
+
.with(basic_auth: %w(user pass),
|
121
|
+
headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT })
|
122
122
|
end
|
123
123
|
|
124
124
|
it "delegates to HTTParty" do
|
125
125
|
stub_request(:get, %r{/foo})
|
126
126
|
|
127
|
-
expect(HTTParty).to receive(:get)
|
128
|
-
with(
|
127
|
+
expect(HTTParty).to receive(:get)
|
128
|
+
.with(
|
129
129
|
"#{subject.base_url}foo",
|
130
130
|
format: :json,
|
131
131
|
basic_auth: { username: "user", password: "pass" },
|
132
132
|
headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT }
|
133
|
-
)
|
134
|
-
and_return(double('response', code: 200))
|
133
|
+
)
|
134
|
+
.and_return(double('response', code: 200))
|
135
135
|
|
136
136
|
subject.request(:get, 'foo')
|
137
137
|
end
|
138
138
|
|
139
139
|
it "properly extracts processes options and encodes data" do
|
140
|
-
expect(HTTParty).to receive(:put)
|
141
|
-
with(
|
140
|
+
expect(HTTParty).to receive(:put)
|
141
|
+
.with(
|
142
142
|
"#{subject.base_url}foo",
|
143
143
|
format: :json,
|
144
144
|
body: JSON.dump(something: "else"),
|
145
145
|
query: { foo: "bar" },
|
146
146
|
basic_auth: { username: "user", password: "pass" },
|
147
147
|
headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT, "Custom" => "Header" }
|
148
|
-
)
|
149
|
-
and_return(double('response', code: 200))
|
148
|
+
)
|
149
|
+
.and_return(double('response', code: 200))
|
150
150
|
|
151
151
|
subject.request(:put, 'foo', { something: "else" }, { query: { foo: "bar" }, headers: { "Custom" => "Header" } })
|
152
152
|
end
|
153
153
|
|
154
154
|
it "handles non application/json content types" do
|
155
|
-
expect(HTTParty).to receive(:post)
|
156
|
-
with(
|
155
|
+
expect(HTTParty).to receive(:post)
|
156
|
+
.with(
|
157
157
|
"#{subject.base_url}foo",
|
158
158
|
format: :json,
|
159
159
|
body: { something: "else" },
|
160
160
|
basic_auth: { username: "user", password: "pass" },
|
161
161
|
headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => Dnsimple::Default::USER_AGENT }
|
162
|
-
)
|
163
|
-
and_return(double('response', code: 200))
|
162
|
+
)
|
163
|
+
.and_return(double('response', code: 200))
|
164
164
|
|
165
165
|
subject.request(:post, 'foo', { something: "else" }, { headers: { "Content-Type" => "application/x-www-form-urlencoded" } })
|
166
166
|
end
|
167
167
|
|
168
168
|
it "includes options for proxy support" do
|
169
|
-
expect(HTTParty).to receive(:get)
|
170
|
-
with(
|
169
|
+
expect(HTTParty).to receive(:get)
|
170
|
+
.with(
|
171
171
|
"#{subject.base_url}test",
|
172
172
|
format: :json,
|
173
173
|
http_proxyaddr: "example-proxy.com",
|
174
174
|
http_proxyport: "4321",
|
175
175
|
headers: { 'Accept' => 'application/json', 'User-Agent' => Dnsimple::Default::USER_AGENT }
|
176
|
-
)
|
177
|
-
and_return(double('response', code: 200))
|
176
|
+
)
|
177
|
+
.and_return(double('response', code: 200))
|
178
178
|
|
179
179
|
subject = described_class.new(proxy: "example-proxy.com:4321")
|
180
180
|
subject.request(:get, "test", nil, {})
|
181
181
|
end
|
182
182
|
|
183
183
|
it "supports custom user agent" do
|
184
|
-
expect(HTTParty).to receive(:get)
|
185
|
-
with(
|
184
|
+
expect(HTTParty).to receive(:get)
|
185
|
+
.with(
|
186
186
|
"#{subject.base_url}test",
|
187
187
|
format: :json,
|
188
188
|
headers: hash_including("User-Agent" => "#{Dnsimple::Default::USER_AGENT} customAgent")
|
189
|
-
)
|
190
|
-
and_return(double("response", code: 200))
|
189
|
+
)
|
190
|
+
.and_return(double("response", code: 200))
|
191
191
|
|
192
192
|
subject = described_class.new(user_agent: "customAgent")
|
193
193
|
subject.request(:get, "test", nil)
|
metadata
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dnsimple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Eden
|
8
8
|
- Simone Carletti
|
9
9
|
- Javier Acero
|
10
|
-
- Joseph Caudle
|
11
10
|
- Luca Guidi
|
12
11
|
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date: 2017-
|
14
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: httparty
|
@@ -89,7 +88,6 @@ email:
|
|
89
88
|
- anthony.eden@dnsimple.com
|
90
89
|
- simone.carletti@dnsimple.com
|
91
90
|
- javier.acero@dnsimple.com
|
92
|
-
- joseph.caudle@dnsimple.com
|
93
91
|
- luca.guidi@dnsimple.com
|
94
92
|
executables: []
|
95
93
|
extensions: []
|
@@ -346,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
346
344
|
version: '0'
|
347
345
|
requirements: []
|
348
346
|
rubyforge_project:
|
349
|
-
rubygems_version: 2.6.
|
347
|
+
rubygems_version: 2.6.10
|
350
348
|
signing_key:
|
351
349
|
specification_version: 4
|
352
350
|
summary: The DNSimple API client for Ruby
|