stub_requests 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -2
  3. data/.reek.yml +1 -0
  4. data/.rubocop.yml +33 -35
  5. data/.simplecov +14 -8
  6. data/.yardopts +1 -1
  7. data/CHANGELOG.md +4 -1
  8. data/README.md +19 -11
  9. data/Rakefile +1 -3
  10. data/bin/update_docs.sh +16 -0
  11. data/gemfiles/webmock_2.3.gemfile.lock +1 -1
  12. data/gemfiles/webmock_3.5.gemfile.lock +1 -1
  13. data/gemfiles/webmock_develop.gemfile.lock +1 -1
  14. data/lib/rspec/subject_as_lambda.rb +138 -0
  15. data/lib/stub_requests/api.rb +42 -8
  16. data/lib/stub_requests/argument_validation.rb +17 -6
  17. data/lib/stub_requests/configuration.rb +21 -0
  18. data/lib/stub_requests/core_ext/all.rb +4 -0
  19. data/lib/stub_requests/core_ext/array/extract_options.rb +32 -0
  20. data/lib/stub_requests/core_ext/class/attribute.rb +61 -0
  21. data/lib/stub_requests/core_ext/kernel/singleton_class.rb +12 -0
  22. data/lib/stub_requests/core_ext/module/redefine_method.rb +44 -0
  23. data/lib/stub_requests/core_ext/object/blank.rb +99 -155
  24. data/lib/stub_requests/endpoint.rb +28 -30
  25. data/lib/stub_requests/endpoint_registry.rb +18 -16
  26. data/lib/stub_requests/exceptions.rb +84 -0
  27. data/lib/stub_requests/hash_util.rb +2 -0
  28. data/lib/stub_requests/metrics/endpoint_stat.rb +97 -0
  29. data/lib/stub_requests/metrics/registry.rb +132 -0
  30. data/lib/stub_requests/metrics/stub_stat.rb +80 -0
  31. data/lib/stub_requests/metrics.rb +32 -0
  32. data/lib/stub_requests/property/validator.rb +136 -0
  33. data/lib/stub_requests/property.rb +99 -0
  34. data/lib/stub_requests/service.rb +12 -53
  35. data/lib/stub_requests/service_registry.rb +8 -9
  36. data/lib/stub_requests/stub_requests.rb +23 -51
  37. data/lib/stub_requests/uri/builder.rb +5 -1
  38. data/lib/stub_requests/uri/scheme.rb +3 -1
  39. data/lib/stub_requests/uri/suffix.rb +5 -0
  40. data/lib/stub_requests/uri/validator.rb +3 -1
  41. data/lib/stub_requests/uri.rb +34 -0
  42. data/lib/stub_requests/version.rb +1 -1
  43. data/lib/stub_requests/webmock/builder.rb +116 -0
  44. data/lib/stub_requests/webmock/stub_registry_extension.rb +46 -0
  45. data/lib/stub_requests.rb +21 -3
  46. metadata +19 -49
  47. data/docs/.gitkeep +0 -0
  48. data/docs/Array.html +0 -137
  49. data/docs/FalseClass.html +0 -232
  50. data/docs/Hash.html +0 -137
  51. data/docs/NilClass.html +0 -232
  52. data/docs/Numeric.html +0 -233
  53. data/docs/Object.html +0 -396
  54. data/docs/String.html +0 -298
  55. data/docs/StubRequests/API.html +0 -651
  56. data/docs/StubRequests/ArgumentValidation.html +0 -309
  57. data/docs/StubRequests/Endpoint.html +0 -1187
  58. data/docs/StubRequests/EndpointNotFound.html +0 -157
  59. data/docs/StubRequests/EndpointRegistry.html +0 -1527
  60. data/docs/StubRequests/Error.html +0 -153
  61. data/docs/StubRequests/HashUtil.html +0 -304
  62. data/docs/StubRequests/InvalidType.html +0 -252
  63. data/docs/StubRequests/InvalidUri.html +0 -252
  64. data/docs/StubRequests/Service.html +0 -1307
  65. data/docs/StubRequests/ServiceHaveEndpoints.html +0 -244
  66. data/docs/StubRequests/ServiceNotFound.html +0 -252
  67. data/docs/StubRequests/ServiceRegistry.html +0 -1031
  68. data/docs/StubRequests/URI/Builder.html +0 -1194
  69. data/docs/StubRequests/URI/Scheme.html +0 -315
  70. data/docs/StubRequests/URI/Suffix.html +0 -315
  71. data/docs/StubRequests/URI/Validator.html +0 -770
  72. data/docs/StubRequests/URI.html +0 -144
  73. data/docs/StubRequests/UriSegmentMismatch.html +0 -157
  74. data/docs/StubRequests/WebMockBuilder.html +0 -887
  75. data/docs/StubRequests.html +0 -452
  76. data/docs/Time.html +0 -232
  77. data/docs/TrueClass.html +0 -232
  78. data/docs/_config.yml +0 -1
  79. data/docs/_index.html +0 -391
  80. data/docs/class_list.html +0 -51
  81. data/docs/css/common.css +0 -1
  82. data/docs/css/full_list.css +0 -58
  83. data/docs/css/style.css +0 -496
  84. data/docs/file.README.html +0 -225
  85. data/docs/file_list.html +0 -56
  86. data/docs/frames.html +0 -17
  87. data/docs/index.html +0 -225
  88. data/docs/js/app.js +0 -292
  89. data/docs/js/full_list.js +0 -216
  90. data/docs/js/jquery.js +0 -4
  91. data/docs/method_list.html +0 -707
  92. data/docs/top-level-namespace.html +0 -112
  93. data/lib/stub_requests/webmock_builder.rb +0 -108
@@ -1,309 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Module: StubRequests::ArgumentValidation
8
-
9
- &mdash; Documentation by YARD 0.9.18
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "StubRequests::ArgumentValidation";
19
- relpath = '../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../_index.html">Index (A)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../StubRequests.html" title="StubRequests (module)">StubRequests</a></span></span>
41
- &raquo;
42
- <span class="title">ArgumentValidation</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Module: StubRequests::ArgumentValidation
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
- <dl>
73
- <dt>Extended by:</dt>
74
- <dd><span class='object_link'><a href="" title="StubRequests::ArgumentValidation (module)">ArgumentValidation</a></span></dd>
75
- </dl>
76
-
77
-
78
-
79
-
80
-
81
-
82
- <dl>
83
- <dt>Included in:</dt>
84
- <dd><span class='object_link'><a href="" title="StubRequests::ArgumentValidation (module)">ArgumentValidation</a></span>, <span class='object_link'><a href="Endpoint.html" title="StubRequests::Endpoint (class)">Endpoint</a></span>, <span class='object_link'><a href="Service.html" title="StubRequests::Service (class)">Service</a></span></dd>
85
- </dl>
86
-
87
-
88
-
89
- <dl>
90
- <dt>Defined in:</dt>
91
- <dd>lib/stub_requests/argument_validation.rb</dd>
92
- </dl>
93
-
94
- </div>
95
-
96
- <h2>Overview</h2><div class="docstring">
97
- <div class="discussion">
98
- <p>Module ArgumentValidation provides validation of method arguments</p>
99
-
100
-
101
- </div>
102
- </div>
103
- <div class="tags">
104
-
105
- <p class="tag_title">Since:</p>
106
- <ul class="since">
107
-
108
- <li>
109
-
110
-
111
-
112
-
113
-
114
- <div class='inline'><p>0.1.0</p>
115
- </div>
116
-
117
- </li>
118
-
119
- </ul>
120
-
121
- </div>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
- <h2>
130
- Instance Method Summary
131
- <small><a href="#" class="summary_toggle">collapse</a></small>
132
- </h2>
133
-
134
- <ul class="summary">
135
-
136
- <li class="public ">
137
- <span class="summary_signature">
138
-
139
- <a href="#validate!-instance_method" title="#validate! (instance method)">#<strong>validate!</strong>(value, is_a:) &#x21d2; true </a>
140
-
141
-
142
-
143
- </span>
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
- <span class="summary_desc"><div class='inline'><p>Require the value to be any of the types past in.</p>
154
- </div></span>
155
-
156
- </li>
157
-
158
-
159
- </ul>
160
-
161
-
162
-
163
-
164
- <div id="instance_method_details" class="method_details_list">
165
- <h2>Instance Method Details</h2>
166
-
167
-
168
- <div class="method_details first">
169
- <h3 class="signature first" id="validate!-instance_method">
170
-
171
- #<strong>validate!</strong>(value, is_a:) &#x21d2; <tt>true</tt>
172
-
173
-
174
-
175
-
176
-
177
- </h3><div class="docstring">
178
- <div class="discussion">
179
- <p>Require the value to be any of the types past in</p>
180
-
181
-
182
- </div>
183
- </div>
184
- <div class="tags">
185
- <p class="tag_title">Parameters:</p>
186
- <ul class="param">
187
-
188
- <li>
189
-
190
- <span class='name'>value</span>
191
-
192
-
193
- <span class='type'>(<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>)</span>
194
-
195
-
196
-
197
- &mdash;
198
- <div class='inline'><p>the value to validate</p>
199
- </div>
200
-
201
- </li>
202
-
203
- <li>
204
-
205
- <span class='name'>is_a</span>
206
-
207
-
208
- <span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span>&lt;Class&gt;</tt>, <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span>&lt;Module&gt;</tt>, <tt>Class</tt>, <tt>Module</tt>)</span>
209
-
210
-
211
-
212
- </li>
213
-
214
- </ul>
215
-
216
- <p class="tag_title">Returns:</p>
217
- <ul class="return">
218
-
219
- <li>
220
-
221
-
222
- <span class='type'>(<tt>true</tt>)</span>
223
-
224
-
225
-
226
- &mdash;
227
- <div class='inline'><p>when the value is allowed</p>
228
- </div>
229
-
230
- </li>
231
-
232
- </ul>
233
- <p class="tag_title">Raises:</p>
234
- <ul class="raise">
235
-
236
- <li>
237
-
238
-
239
- <span class='type'>(<tt><span class='object_link'><a href="InvalidType.html" title="StubRequests::InvalidType (class)">InvalidType</a></span></tt>)</span>
240
-
241
-
242
-
243
- &mdash;
244
- <div class='inline'><p>when the value is disallowed</p>
245
- </div>
246
-
247
- </li>
248
-
249
- </ul>
250
- <p class="tag_title">Since:</p>
251
- <ul class="since">
252
-
253
- <li>
254
-
255
-
256
-
257
-
258
-
259
- <div class='inline'><p>0.1.0</p>
260
- </div>
261
-
262
- </li>
263
-
264
- </ul>
265
-
266
- </div><table class="source_code">
267
- <tr>
268
- <td>
269
- <pre class="lines">
270
-
271
-
272
- 30
273
- 31
274
- 32
275
- 33
276
- 34
277
- 35
278
- 36
279
- 37</pre>
280
- </td>
281
- <td>
282
- <pre class="code"><span class="info file"># File 'lib/stub_requests/argument_validation.rb', line 30</span>
283
-
284
- <span class='kw'>def</span> <span class='id identifier rubyid_validate!'>validate!</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>is_a:</span><span class='rparen'>)</span>
285
- <span class='id identifier rubyid_expected_types'>expected_types</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_is_a'>is_a</span><span class='rparen'>)</span>
286
- <span class='kw'>return</span> <span class='kw'>true</span> <span class='kw'>if</span> <span class='id identifier rubyid_expected_types'>expected_types</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_type'>type</span><span class='op'>|</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
287
-
288
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../StubRequests.html" title="StubRequests (module)">StubRequests</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="InvalidType.html" title="StubRequests::InvalidType (class)">InvalidType</a></span></span><span class='comma'>,</span>
289
- <span class='label'>actual:</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='comma'>,</span>
290
- <span class='label'>expected:</span> <span class='id identifier rubyid_expected_types'>expected_types</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
291
- <span class='kw'>end</span></pre>
292
- </td>
293
- </tr>
294
- </table>
295
- </div>
296
-
297
- </div>
298
-
299
- </div>
300
-
301
- <div id="footer">
302
- Generated on Fri Feb 1 19:57:29 2019 by
303
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
304
- 0.9.18 (ruby-2.5.3).
305
- </div>
306
-
307
- </div>
308
- </body>
309
- </html>