serverspec-extra-types 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -1
  3. data/Gemfile +2 -0
  4. data/Rakefile +2 -0
  5. data/bin/console +1 -0
  6. data/lib/serverspec_extra_types/helpers/properties.rb +2 -0
  7. data/lib/serverspec_extra_types/matchers/be_a_manager_node.rb +2 -0
  8. data/lib/serverspec_extra_types/matchers/be_a_worker_node.rb +2 -0
  9. data/lib/serverspec_extra_types/matchers/be_active.rb +2 -0
  10. data/lib/serverspec_extra_types/matchers/configure_queue.rb +2 -0
  11. data/lib/serverspec_extra_types/matchers/have_count.rb +2 -0
  12. data/lib/serverspec_extra_types/matchers/have_domain_name.rb +2 -0
  13. data/lib/serverspec_extra_types/matchers/have_engine_version.rb +2 -0
  14. data/lib/serverspec_extra_types/matchers/have_environment_variable.rb +2 -0
  15. data/lib/serverspec_extra_types/matchers/have_ha_mode.rb +2 -0
  16. data/lib/serverspec_extra_types/matchers/have_ha_nodes.rb +2 -0
  17. data/lib/serverspec_extra_types/matchers/have_ha_sync_mode.rb +2 -0
  18. data/lib/serverspec_extra_types/matchers/have_host.rb +2 -0
  19. data/lib/serverspec_extra_types/matchers/have_hostname.rb +2 -0
  20. data/lib/serverspec_extra_types/matchers/have_image.rb +2 -0
  21. data/lib/serverspec_extra_types/matchers/have_image_sha.rb +2 -0
  22. data/lib/serverspec_extra_types/matchers/have_label.rb +4 -2
  23. data/lib/serverspec_extra_types/matchers/have_mount.rb +2 -0
  24. data/lib/serverspec_extra_types/matchers/have_network.rb +2 -0
  25. data/lib/serverspec_extra_types/matchers/have_placement_constraint.rb +2 -0
  26. data/lib/serverspec_extra_types/matchers/have_replica_count.rb +2 -0
  27. data/lib/serverspec_extra_types/matchers/have_restart_limit.rb +2 -0
  28. data/lib/serverspec_extra_types/matchers/have_restart_policy.rb +2 -0
  29. data/lib/serverspec_extra_types/matchers/have_user.rb +2 -0
  30. data/lib/serverspec_extra_types/matchers/have_vhost.rb +2 -0
  31. data/lib/serverspec_extra_types/matchers/http_1xx.rb +109 -0
  32. data/lib/serverspec_extra_types/matchers/http_2xx.rb +361 -0
  33. data/lib/serverspec_extra_types/matchers/http_3xx.rb +289 -0
  34. data/lib/serverspec_extra_types/matchers/http_4xx.rb +1081 -0
  35. data/lib/serverspec_extra_types/matchers/http_5xx.rb +433 -0
  36. data/lib/serverspec_extra_types/matchers/include_regex.rb +2 -0
  37. data/lib/serverspec_extra_types/matchers/map_port.rb +2 -0
  38. data/lib/serverspec_extra_types/matchers/mirror_all.rb +2 -0
  39. data/lib/serverspec_extra_types/matchers/publish_all_ports.rb +2 -0
  40. data/lib/serverspec_extra_types/matchers/read_from_queue.rb +2 -0
  41. data/lib/serverspec_extra_types/matchers/url_matchers.rb +7 -0
  42. data/lib/serverspec_extra_types/matchers/write_to_queue.rb +2 -0
  43. data/lib/serverspec_extra_types/matchers.rb +4 -0
  44. data/lib/serverspec_extra_types/types/api_base.rb +2 -0
  45. data/lib/serverspec_extra_types/types/consul_base.rb +2 -0
  46. data/lib/serverspec_extra_types/types/consul_node.rb +2 -0
  47. data/lib/serverspec_extra_types/types/consul_node_list.rb +2 -0
  48. data/lib/serverspec_extra_types/types/consul_service.rb +2 -0
  49. data/lib/serverspec_extra_types/types/consul_service_list.rb +2 -0
  50. data/lib/serverspec_extra_types/types/curl.rb +69 -0
  51. data/lib/serverspec_extra_types/types/docker_container.rb +2 -0
  52. data/lib/serverspec_extra_types/types/docker_network.rb +2 -2
  53. data/lib/serverspec_extra_types/types/docker_node.rb +2 -0
  54. data/lib/serverspec_extra_types/types/docker_service.rb +2 -0
  55. data/lib/serverspec_extra_types/types/rabbitmq_base.rb +2 -0
  56. data/lib/serverspec_extra_types/types/rabbitmq_node_list.rb +2 -0
  57. data/lib/serverspec_extra_types/types/rabbitmq_user_permission.rb +2 -0
  58. data/lib/serverspec_extra_types/types/rabbitmq_vhost_list.rb +2 -0
  59. data/lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb +2 -0
  60. data/lib/serverspec_extra_types/types.rb +4 -1
  61. data/lib/serverspec_extra_types/version.rb +3 -1
  62. data/lib/serverspec_extra_types.rb +2 -0
  63. metadata +10 -3
@@ -0,0 +1,433 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec::Matchers.define :respond_with_500 do
4
+ match do |actual|
5
+ actual.response_code == 500
6
+ end
7
+ failure_message do |actual|
8
+ "expected #{actual} to respond with 500 was #{actual.response_code}"
9
+ end
10
+ end
11
+
12
+ RSpec::Matchers.define :respond_with_INTERNAL_SERVER_ERROR do
13
+ match do |actual|
14
+ actual.response_code == 500
15
+ end
16
+ failure_message do |actual|
17
+ "expected #{actual} to respond with 500 was #{actual.response_code}"
18
+ end
19
+ end
20
+
21
+ RSpec::Matchers.define :respond_with_internal_server_error do
22
+ match do |actual|
23
+ actual.response_code == 500
24
+ end
25
+ failure_message do |actual|
26
+ "expected #{actual} to respond with 500 was #{actual.response_code}"
27
+ end
28
+ end
29
+
30
+ RSpec::Matchers.define :be_internal_server_error do
31
+ match do |actual|
32
+ actual.response_code == 500
33
+ end
34
+ failure_message do |actual|
35
+ "expected #{actual} to respond with 500 was #{actual.response_code}"
36
+ end
37
+ end
38
+
39
+ RSpec::Matchers.define :respond_with_501 do
40
+ match do |actual|
41
+ actual.response_code == 501
42
+ end
43
+ failure_message do |actual|
44
+ "expected #{actual} to respond with 501 was #{actual.response_code}"
45
+ end
46
+ end
47
+
48
+ RSpec::Matchers.define :respond_with_NOT_IMPLEMENTED do
49
+ match do |actual|
50
+ actual.response_code == 501
51
+ end
52
+ failure_message do |actual|
53
+ "expected #{actual} to respond with 501 was #{actual.response_code}"
54
+ end
55
+ end
56
+
57
+ RSpec::Matchers.define :respond_with_not_implemented do
58
+ match do |actual|
59
+ actual.response_code == 501
60
+ end
61
+ failure_message do |actual|
62
+ "expected #{actual} to respond with 501 was #{actual.response_code}"
63
+ end
64
+ end
65
+
66
+ RSpec::Matchers.define :be_not_implemented do
67
+ match do |actual|
68
+ actual.response_code == 501
69
+ end
70
+ failure_message do |actual|
71
+ "expected #{actual} to respond with 501 was #{actual.response_code}"
72
+ end
73
+ end
74
+
75
+ RSpec::Matchers.define :respond_with_502 do
76
+ match do |actual|
77
+ actual.response_code == 502
78
+ end
79
+ failure_message do |actual|
80
+ "expected #{actual} to respond with 502 was #{actual.response_code}"
81
+ end
82
+ end
83
+
84
+ RSpec::Matchers.define :respond_with_BAD_GATEWAY do
85
+ match do |actual|
86
+ actual.response_code == 502
87
+ end
88
+ failure_message do |actual|
89
+ "expected #{actual} to respond with 502 was #{actual.response_code}"
90
+ end
91
+ end
92
+
93
+ RSpec::Matchers.define :respond_with_bad_gateway do
94
+ match do |actual|
95
+ actual.response_code == 502
96
+ end
97
+ failure_message do |actual|
98
+ "expected #{actual} to respond with 502 was #{actual.response_code}"
99
+ end
100
+ end
101
+
102
+ RSpec::Matchers.define :be_bad_gateway do
103
+ match do |actual|
104
+ actual.response_code == 502
105
+ end
106
+ failure_message do |actual|
107
+ "expected #{actual} to respond with 502 was #{actual.response_code}"
108
+ end
109
+ end
110
+
111
+ RSpec::Matchers.define :respond_with_503 do
112
+ match do |actual|
113
+ actual.response_code == 503
114
+ end
115
+ failure_message do |actual|
116
+ "expected #{actual} to respond with 503 was #{actual.response_code}"
117
+ end
118
+ end
119
+
120
+ RSpec::Matchers.define :respond_with_SERVICE_UNAVAILABLE do
121
+ match do |actual|
122
+ actual.response_code == 503
123
+ end
124
+ failure_message do |actual|
125
+ "expected #{actual} to respond with 503 was #{actual.response_code}"
126
+ end
127
+ end
128
+
129
+ RSpec::Matchers.define :respond_with_service_unavailable do
130
+ match do |actual|
131
+ actual.response_code == 503
132
+ end
133
+ failure_message do |actual|
134
+ "expected #{actual} to respond with 503 was #{actual.response_code}"
135
+ end
136
+ end
137
+
138
+ RSpec::Matchers.define :be_service_unavailable do
139
+ match do |actual|
140
+ actual.response_code == 503
141
+ end
142
+ failure_message do |actual|
143
+ "expected #{actual} to respond with 503 was #{actual.response_code}"
144
+ end
145
+ end
146
+
147
+ RSpec::Matchers.define :respond_with_504 do
148
+ match do |actual|
149
+ actual.response_code == 504
150
+ end
151
+ failure_message do |actual|
152
+ "expected #{actual} to respond with 504 was #{actual.response_code}"
153
+ end
154
+ end
155
+
156
+ RSpec::Matchers.define :respond_with_GATEWAY_TIMEOUT do
157
+ match do |actual|
158
+ actual.response_code == 504
159
+ end
160
+ failure_message do |actual|
161
+ "expected #{actual} to respond with 504 was #{actual.response_code}"
162
+ end
163
+ end
164
+
165
+ RSpec::Matchers.define :respond_with_gateway_timeout do
166
+ match do |actual|
167
+ actual.response_code == 504
168
+ end
169
+ failure_message do |actual|
170
+ "expected #{actual} to respond with 504 was #{actual.response_code}"
171
+ end
172
+ end
173
+
174
+ RSpec::Matchers.define :be_gateway_timeout do
175
+ match do |actual|
176
+ actual.response_code == 504
177
+ end
178
+ failure_message do |actual|
179
+ "expected #{actual} to respond with 504 was #{actual.response_code}"
180
+ end
181
+ end
182
+
183
+ RSpec::Matchers.define :respond_with_505 do
184
+ match do |actual|
185
+ actual.response_code == 505
186
+ end
187
+ failure_message do |actual|
188
+ "expected #{actual} to respond with 505 was #{actual.response_code}"
189
+ end
190
+ end
191
+
192
+ RSpec::Matchers.define :respond_with_HTTP_VERSION_NOT_SUPPORTED do
193
+ match do |actual|
194
+ actual.response_code == 505
195
+ end
196
+ failure_message do |actual|
197
+ "expected #{actual} to respond with 505 was #{actual.response_code}"
198
+ end
199
+ end
200
+
201
+ RSpec::Matchers.define :respond_with_http_version_not_supported do
202
+ match do |actual|
203
+ actual.response_code == 505
204
+ end
205
+ failure_message do |actual|
206
+ "expected #{actual} to respond with 505 was #{actual.response_code}"
207
+ end
208
+ end
209
+
210
+ RSpec::Matchers.define :be_http_version_not_supported do
211
+ match do |actual|
212
+ actual.response_code == 505
213
+ end
214
+ failure_message do |actual|
215
+ "expected #{actual} to respond with 505 was #{actual.response_code}"
216
+ end
217
+ end
218
+
219
+ RSpec::Matchers.define :respond_with_506 do
220
+ match do |actual|
221
+ actual.response_code == 506
222
+ end
223
+ failure_message do |actual|
224
+ "expected #{actual} to respond with 506 was #{actual.response_code}"
225
+ end
226
+ end
227
+
228
+ RSpec::Matchers.define :respond_with_VARIANT_ALSO_NEGOTIATES do
229
+ match do |actual|
230
+ actual.response_code == 506
231
+ end
232
+ failure_message do |actual|
233
+ "expected #{actual} to respond with 506 was #{actual.response_code}"
234
+ end
235
+ end
236
+
237
+ RSpec::Matchers.define :respond_with_variant_also_negotiates do
238
+ match do |actual|
239
+ actual.response_code == 506
240
+ end
241
+ failure_message do |actual|
242
+ "expected #{actual} to respond with 506 was #{actual.response_code}"
243
+ end
244
+ end
245
+
246
+ RSpec::Matchers.define :be_variant_also_negotiates do
247
+ match do |actual|
248
+ actual.response_code == 506
249
+ end
250
+ failure_message do |actual|
251
+ "expected #{actual} to respond with 506 was #{actual.response_code}"
252
+ end
253
+ end
254
+
255
+ RSpec::Matchers.define :respond_with_507 do
256
+ match do |actual|
257
+ actual.response_code == 507
258
+ end
259
+ failure_message do |actual|
260
+ "expected #{actual} to respond with 507 was #{actual.response_code}"
261
+ end
262
+ end
263
+
264
+ RSpec::Matchers.define :respond_with_INSUFFICIENT_STORAGE do
265
+ match do |actual|
266
+ actual.response_code == 507
267
+ end
268
+ failure_message do |actual|
269
+ "expected #{actual} to respond with 507 was #{actual.response_code}"
270
+ end
271
+ end
272
+
273
+ RSpec::Matchers.define :respond_with_insufficient_storage do
274
+ match do |actual|
275
+ actual.response_code == 507
276
+ end
277
+ failure_message do |actual|
278
+ "expected #{actual} to respond with 507 was #{actual.response_code}"
279
+ end
280
+ end
281
+
282
+ RSpec::Matchers.define :be_insufficient_storage do
283
+ match do |actual|
284
+ actual.response_code == 507
285
+ end
286
+ failure_message do |actual|
287
+ "expected #{actual} to respond with 507 was #{actual.response_code}"
288
+ end
289
+ end
290
+
291
+ RSpec::Matchers.define :respond_with_508 do
292
+ match do |actual|
293
+ actual.response_code == 508
294
+ end
295
+ failure_message do |actual|
296
+ "expected #{actual} to respond with 508 was #{actual.response_code}"
297
+ end
298
+ end
299
+
300
+ RSpec::Matchers.define :respond_with_LOOP_DETECTED do
301
+ match do |actual|
302
+ actual.response_code == 508
303
+ end
304
+ failure_message do |actual|
305
+ "expected #{actual} to respond with 508 was #{actual.response_code}"
306
+ end
307
+ end
308
+
309
+ RSpec::Matchers.define :respond_with_loop_detected do
310
+ match do |actual|
311
+ actual.response_code == 508
312
+ end
313
+ failure_message do |actual|
314
+ "expected #{actual} to respond with 508 was #{actual.response_code}"
315
+ end
316
+ end
317
+
318
+ RSpec::Matchers.define :be_loop_detected do
319
+ match do |actual|
320
+ actual.response_code == 508
321
+ end
322
+ failure_message do |actual|
323
+ "expected #{actual} to respond with 508 was #{actual.response_code}"
324
+ end
325
+ end
326
+
327
+ RSpec::Matchers.define :respond_with_510 do
328
+ match do |actual|
329
+ actual.response_code == 510
330
+ end
331
+ failure_message do |actual|
332
+ "expected #{actual} to respond with 510 was #{actual.response_code}"
333
+ end
334
+ end
335
+
336
+ RSpec::Matchers.define :respond_with_NOT_EXTENDED do
337
+ match do |actual|
338
+ actual.response_code == 510
339
+ end
340
+ failure_message do |actual|
341
+ "expected #{actual} to respond with 510 was #{actual.response_code}"
342
+ end
343
+ end
344
+
345
+ RSpec::Matchers.define :respond_with_not_extended do
346
+ match do |actual|
347
+ actual.response_code == 510
348
+ end
349
+ failure_message do |actual|
350
+ "expected #{actual} to respond with 510 was #{actual.response_code}"
351
+ end
352
+ end
353
+
354
+ RSpec::Matchers.define :be_not_extended do
355
+ match do |actual|
356
+ actual.response_code == 510
357
+ end
358
+ failure_message do |actual|
359
+ "expected #{actual} to respond with 510 was #{actual.response_code}"
360
+ end
361
+ end
362
+
363
+ RSpec::Matchers.define :respond_with_511 do
364
+ match do |actual|
365
+ actual.response_code == 511
366
+ end
367
+ failure_message do |actual|
368
+ "expected #{actual} to respond with 511 was #{actual.response_code}"
369
+ end
370
+ end
371
+
372
+ RSpec::Matchers.define :respond_with_NETWORK_AUTHENTICATION_REQUIRED do
373
+ match do |actual|
374
+ actual.response_code == 511
375
+ end
376
+ failure_message do |actual|
377
+ "expected #{actual} to respond with 511 was #{actual.response_code}"
378
+ end
379
+ end
380
+
381
+ RSpec::Matchers.define :respond_with_network_authentication_required do
382
+ match do |actual|
383
+ actual.response_code == 511
384
+ end
385
+ failure_message do |actual|
386
+ "expected #{actual} to respond with 511 was #{actual.response_code}"
387
+ end
388
+ end
389
+
390
+ RSpec::Matchers.define :be_network_authentication_required do
391
+ match do |actual|
392
+ actual.response_code == 511
393
+ end
394
+ failure_message do |actual|
395
+ "expected #{actual} to respond with 511 was #{actual.response_code}"
396
+ end
397
+ end
398
+
399
+ RSpec::Matchers.define :respond_with_599 do
400
+ match do |actual|
401
+ actual.response_code == 599
402
+ end
403
+ failure_message do |actual|
404
+ "expected #{actual} to respond with 599 was #{actual.response_code}"
405
+ end
406
+ end
407
+
408
+ RSpec::Matchers.define :respond_with_NETWORK_CONNECT_TIMEOUT_ERROR do
409
+ match do |actual|
410
+ actual.response_code == 599
411
+ end
412
+ failure_message do |actual|
413
+ "expected #{actual} to respond with 599 was #{actual.response_code}"
414
+ end
415
+ end
416
+
417
+ RSpec::Matchers.define :respond_with_network_connect_timeout_error do
418
+ match do |actual|
419
+ actual.response_code == 599
420
+ end
421
+ failure_message do |actual|
422
+ "expected #{actual} to respond with 599 was #{actual.response_code}"
423
+ end
424
+ end
425
+
426
+ RSpec::Matchers.define :be_network_connect_timeout_error do
427
+ match do |actual|
428
+ actual.response_code == 599
429
+ end
430
+ failure_message do |actual|
431
+ "expected #{actual} to respond with 599 was #{actual.response_code}"
432
+ end
433
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Matchers.define :include_regex do |regex|
2
4
  match do |actual|
3
5
  actual.include_regex? regex
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Matchers.define :map_port do |host, container|
2
4
  match do |actual|
3
5
  @protocol ||= 'tcp'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec::Matchers.define :mirror_all do
2
4
  match(&:mirror_all?)
3
5
  end