acfs 1.6.0 → 2.0.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.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +144 -115
  3. data/README.md +33 -41
  4. data/acfs.gemspec +9 -10
  5. data/lib/acfs/adapter/typhoeus.rb +6 -4
  6. data/lib/acfs/collections/paginatable.rb +11 -11
  7. data/lib/acfs/configuration.rb +13 -3
  8. data/lib/acfs/errors.rb +7 -7
  9. data/lib/acfs/global.rb +4 -4
  10. data/lib/acfs/location.rb +2 -2
  11. data/lib/acfs/operation.rb +1 -1
  12. data/lib/acfs/request/callbacks.rb +1 -1
  13. data/lib/acfs/request.rb +1 -1
  14. data/lib/acfs/resource/attributes/uuid.rb +2 -2
  15. data/lib/acfs/resource/attributes.rb +1 -1
  16. data/lib/acfs/resource/dirty.rb +1 -1
  17. data/lib/acfs/resource/locatable.rb +2 -2
  18. data/lib/acfs/resource/operational.rb +4 -4
  19. data/lib/acfs/resource/query_methods.rb +5 -5
  20. data/lib/acfs/response/status.rb +1 -1
  21. data/lib/acfs/runner.rb +15 -15
  22. data/lib/acfs/service/middleware.rb +2 -2
  23. data/lib/acfs/singleton_resource.rb +2 -2
  24. data/lib/acfs/stub.rb +35 -30
  25. data/lib/acfs/version.rb +3 -3
  26. data/lib/acfs/yard.rb +1 -0
  27. data/spec/acfs/adapter/typhoeus_spec.rb +4 -4
  28. data/spec/acfs/collection_spec.rb +66 -41
  29. data/spec/acfs/configuration_spec.rb +22 -12
  30. data/spec/acfs/global_spec.rb +14 -12
  31. data/spec/acfs/location_spec.rb +1 -1
  32. data/spec/acfs/middleware/json_spec.rb +9 -9
  33. data/spec/acfs/middleware/{msgpack_spec.rb → message_pack_spec.rb} +7 -7
  34. data/spec/acfs/operation_spec.rb +4 -3
  35. data/spec/acfs/request/callbacks_spec.rb +19 -10
  36. data/spec/acfs/request_spec.rb +15 -19
  37. data/spec/acfs/resource/attributes/boolean_spec.rb +32 -32
  38. data/spec/acfs/resource/attributes/date_time_spec.rb +17 -9
  39. data/spec/acfs/resource/attributes/dict_spec.rb +16 -10
  40. data/spec/acfs/resource/attributes/float_spec.rb +21 -11
  41. data/spec/acfs/resource/attributes/integer_spec.rb +11 -6
  42. data/spec/acfs/resource/attributes/list_spec.rb +13 -8
  43. data/spec/acfs/resource/attributes/uuid_spec.rb +14 -8
  44. data/spec/acfs/resource/attributes_spec.rb +33 -32
  45. data/spec/acfs/resource/dirty_spec.rb +7 -4
  46. data/spec/acfs/resource/initialization_spec.rb +4 -5
  47. data/spec/acfs/resource/loadable_spec.rb +3 -1
  48. data/spec/acfs/resource/locatable_spec.rb +24 -18
  49. data/spec/acfs/resource/{persistance_spec.rb → persistence_spec.rb} +119 -87
  50. data/spec/acfs/resource/query_methods_spec.rb +144 -111
  51. data/spec/acfs/resource/validation_spec.rb +34 -27
  52. data/spec/acfs/response/formats_spec.rb +8 -8
  53. data/spec/acfs/response/status_spec.rb +16 -9
  54. data/spec/acfs/runner_spec.rb +22 -20
  55. data/spec/acfs/service/middleware_spec.rb +3 -3
  56. data/spec/acfs/service_spec.rb +5 -4
  57. data/spec/acfs/singleton_resource_spec.rb +2 -1
  58. data/spec/acfs/stub_spec.rb +64 -65
  59. data/spec/acfs_spec.rb +112 -94
  60. data/spec/spec_helper.rb +10 -6
  61. data/spec/support/hash.rb +1 -1
  62. data/spec/support/response.rb +2 -2
  63. data/spec/support/service.rb +1 -1
  64. data/spec/support/shared/find_callbacks.rb +14 -10
  65. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/LICENSE +21 -0
  66. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +23 -0
  67. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +31 -0
  68. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/CHANGELOG.md +205 -0
  69. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/MIT-LICENSE +21 -0
  70. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/README.rdoc +57 -0
  71. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +67 -0
  72. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/MIT-LICENSE +21 -0
  73. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/README.rdoc +40 -0
  74. data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/CHANGELOG.md +110 -0
  75. data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/MIT-LICENSE +21 -0
  76. data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/README.rdoc +266 -0
  77. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/CHANGELOG.md +157 -0
  78. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/MIT-LICENSE +20 -0
  79. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/README.rdoc +40 -0
  80. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
  81. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
  82. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
  83. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
  84. data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/MIT-LICENSE +21 -0
  85. data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/README.md +243 -0
  86. data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/appraisal.gemspec +29 -0
  87. data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
  88. data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md +48 -0
  89. data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/README.md +138 -0
  90. data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/benchmark.gemspec +32 -0
  91. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/LICENSE +56 -0
  92. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/bigdecimal.gemspec +57 -0
  93. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
  94. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
  95. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
  96. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
  97. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
  98. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
  99. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/LICENSE +20 -0
  100. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/README.md +167 -0
  101. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/connection_pool.gemspec +24 -0
  102. data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/LICENSE +20 -0
  103. data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/README.md +43 -0
  104. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
  105. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
  106. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
  107. data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/License.md +41 -0
  108. data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +84 -0
  109. data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
  110. data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/drb.gemspec +41 -0
  111. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
  112. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
  113. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
  114. data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
  115. data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/LICENSE +20 -0
  116. data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md +118 -0
  117. data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
  118. data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/CHANGELOG.md +465 -0
  119. data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE +24 -0
  120. data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE.SPECS +22 -0
  121. data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/README.md +137 -0
  122. data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/ffi.gemspec +42 -0
  123. data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/LICENSE +19 -0
  124. data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/README.md +298 -0
  125. data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/changelog.md +119 -0
  126. data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/hashdiff.gemspec +39 -0
  127. data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/MIT-LICENSE +20 -0
  128. data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/README.md +127 -0
  129. data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/README.md +195 -0
  130. data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/json.gemspec +64 -0
  131. data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/README.md +104 -0
  132. data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +28 -0
  133. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/CHANGELOG.md +591 -0
  134. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/MIT-LICENSE.txt +23 -0
  135. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/README.md +410 -0
  136. data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
  137. data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/CHANGELOG.md +275 -0
  138. data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/LICENSE.md +20 -0
  139. data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/README.md +121 -0
  140. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
  141. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE.md +9 -0
  142. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/README.md +293 -0
  143. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/CHANGELOG.md +491 -0
  144. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/LICENSE.txt +22 -0
  145. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/README.md +222 -0
  146. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
  147. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
  148. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
  149. data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/CHANGELOG.md +998 -0
  150. data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/MIT-LICENSE +20 -0
  151. data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/README.md +328 -0
  152. data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/license.md +72 -0
  153. data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/readme.md +47 -0
  154. data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
  155. data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
  156. data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +23 -0
  157. data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/README.md +91 -0
  158. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
  159. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
  160. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
  161. data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
  162. data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
  163. data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/rake.gemspec +101 -0
  164. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
  165. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
  166. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
  167. data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/LICENSE.txt +22 -0
  168. data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/README.md +57 -0
  169. data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/LICENSE.md +27 -0
  170. data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/README.md +47 -0
  171. data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/Changelog.md +68 -0
  172. data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/LICENSE.txt +27 -0
  173. data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/README.md +76 -0
  174. data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/rspec-collection_matchers.gemspec +33 -0
  175. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/Changelog.md +2415 -0
  176. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/LICENSE.md +26 -0
  177. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/README.md +389 -0
  178. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/Changelog.md +1352 -0
  179. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/LICENSE.md +25 -0
  180. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/README.md +326 -0
  181. data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/Changelog.md +73 -0
  182. data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/LICENSE.txt +27 -0
  183. data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/README.md +104 -0
  184. data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/rspec-its.gemspec +31 -0
  185. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/Changelog.md +1299 -0
  186. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/LICENSE.md +25 -0
  187. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/README.md +465 -0
  188. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/Changelog.md +408 -0
  189. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/LICENSE.md +23 -0
  190. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/README.md +40 -0
  191. data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
  192. data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/LICENSE.md +20 -0
  193. data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/README.md +45 -0
  194. data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/thor.gemspec +33 -0
  195. data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
  196. data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/LICENSE +22 -0
  197. data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md +588 -0
  198. data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
  199. data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
  200. data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
  201. data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.2/README.md +55 -0
  202. data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
  203. data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
  204. data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/CHANGELOG.md +2104 -0
  205. data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/LICENSE +20 -0
  206. data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/README.md +1222 -0
  207. data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.1.gemspec +36 -0
  208. data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.1.gemspec +33 -0
  209. data/vendor/bundle/ruby/3.4.0/specifications/activemodel-8.0.1.gemspec +26 -0
  210. data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.1.gemspec +38 -0
  211. data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
  212. data/vendor/bundle/ruby/3.4.0/specifications/appraisal-2.5.0.gemspec +31 -0
  213. data/vendor/bundle/ruby/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
  214. data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.0.gemspec +23 -0
  215. data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.1.9.gemspec +25 -0
  216. data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
  217. data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
  218. data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.0.gemspec +28 -0
  219. data/vendor/bundle/ruby/3.4.0/specifications/crack-1.0.0.gemspec +27 -0
  220. data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
  221. data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +37 -0
  222. data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
  223. data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
  224. data/vendor/bundle/ruby/3.4.0/specifications/ethon-0.16.0.gemspec +24 -0
  225. data/vendor/bundle/ruby/3.4.0/specifications/ffi-1.17.1-x86_64-linux-gnu.gemspec +31 -0
  226. data/vendor/bundle/ruby/3.4.0/specifications/hashdiff-1.1.2.gemspec +30 -0
  227. data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.6.gemspec +27 -0
  228. data/vendor/bundle/ruby/3.4.0/specifications/json-2.9.1.gemspec +0 -0
  229. data/vendor/bundle/ruby/3.4.0/specifications/logger-1.6.5.gemspec +22 -0
  230. data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.0.gemspec +27 -0
  231. data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
  232. data/vendor/bundle/ruby/3.4.0/specifications/multi_json-1.15.0.gemspec +26 -0
  233. data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.1-x86_64-linux-gnu.gemspec +31 -0
  234. data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.1.gemspec +24 -0
  235. data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
  236. data/vendor/bundle/ruby/3.4.0/specifications/rack-3.1.8.gemspec +31 -0
  237. data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.0.gemspec +30 -0
  238. data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
  239. data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.2.0.gemspec +28 -0
  240. data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
  241. data/vendor/bundle/ruby/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
  242. data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
  243. data/vendor/bundle/ruby/3.4.0/specifications/rexml-3.4.0.gemspec +25 -0
  244. data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.0.gemspec +31 -0
  245. data/vendor/bundle/ruby/3.4.0/specifications/rspec-collection_matchers-1.2.1.gemspec +27 -0
  246. data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +39 -0
  247. data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +33 -0
  248. data/vendor/bundle/ruby/3.4.0/specifications/rspec-its-2.0.0.gemspec +27 -0
  249. data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +33 -0
  250. data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.2.gemspec +29 -0
  251. data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
  252. data/vendor/bundle/ruby/3.4.0/specifications/thor-1.3.2.gemspec +28 -0
  253. data/vendor/bundle/ruby/3.4.0/specifications/typhoeus-1.4.1.gemspec +24 -0
  254. data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
  255. data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.2.gemspec +23 -0
  256. data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
  257. data/vendor/bundle/ruby/3.4.0/specifications/webmock-3.24.0.gemspec +45 -0
  258. metadata +208 -70
data/lib/acfs/stub.rb CHANGED
@@ -21,11 +21,11 @@ module Acfs
21
21
  end
22
22
  end
23
23
 
24
- def accept?(op)
25
- return opts[:with].call(op) if opts[:with].respond_to?(:call)
24
+ def accept?(operation)
25
+ return opts[:with].call(operation) if opts[:with].respond_to?(:call)
26
26
 
27
- params = op.full_params.stringify_keys
28
- data = op.data.stringify_keys
27
+ params = operation.full_params.stringify_keys
28
+ data = operation.data.stringify_keys
29
29
  with = opts[:with]
30
30
 
31
31
  return true if with.nil?
@@ -33,10 +33,10 @@ module Acfs
33
33
  case opts.fetch(:match, :inclusion)
34
34
  when :legacy
35
35
  return true if with.empty? && params.empty? && data.empty?
36
- if with.reject {|_, v| v.nil? } == params.reject {|_, v| v.nil? }
36
+ if with.compact == params.compact
37
37
  return true
38
38
  end
39
- if with.reject {|_, v| v.nil? } == data.reject {|_, v| v.nil? }
39
+ if with.compact == data.compact
40
40
  return true
41
41
  end
42
42
 
@@ -58,22 +58,25 @@ module Acfs
58
58
  count.nil? ? calls.any? : calls.size == count
59
59
  end
60
60
 
61
- def call(op)
62
- calls << op
61
+ def call(operation)
62
+ calls << operation
63
63
 
64
64
  err = opts[:raise]
65
65
  data = opts[:return]
66
66
 
67
67
  if err
68
- raise_error op, err, opts[:return]
68
+ raise_error(operation, err, opts[:return])
69
69
  elsif data
70
- data = data.call(op) if data.respond_to?(:call)
70
+ data = data.call(operation) if data.respond_to?(:call)
71
71
 
72
- response = Acfs::Response.new op.request,
72
+ response = Acfs::Response.new(
73
+ operation.request,
73
74
  headers: opts[:headers] || {},
74
75
  status: opts[:status] || 200,
75
- data: data || {}
76
- op.call data, response
76
+ data: data || {},
77
+ )
78
+
79
+ operation.call(data, response)
77
80
  else
78
81
  raise ArgumentError.new 'Unsupported stub.'
79
82
  end
@@ -81,15 +84,17 @@ module Acfs
81
84
 
82
85
  private
83
86
 
84
- def raise_error(op, name, data)
87
+ def raise_error(operation, name, data)
85
88
  raise name if name.is_a? Class
86
89
 
87
90
  data.stringify_keys! if data.respond_to?(:stringify_keys!)
88
91
 
89
- op.handle_failure ::Acfs::Response.new(
90
- op.request,
91
- status: Rack::Utils.status_code(name),
92
- data: data
92
+ operation.handle_failure(
93
+ ::Acfs::Response.new(
94
+ operation.request,
95
+ status: Rack::Utils.status_code(name),
96
+ data: data,
97
+ ),
93
98
  )
94
99
  end
95
100
 
@@ -97,7 +102,7 @@ module Acfs
97
102
  # Stub a resource with given handler block. An already created handler
98
103
  # for same resource class will be overridden.
99
104
  #
100
- def resource(klass, action, opts = {}, &_block)
105
+ def resource(klass, action, opts = {}, &)
101
106
  action = action.to_sym
102
107
  unless ACTIONS.include? action
103
108
  raise ArgumentError.new "Unknown action `#{action}`."
@@ -140,35 +145,35 @@ module Acfs
140
145
  @stubs ||= {}
141
146
  end
142
147
 
143
- def stub_for(op)
144
- return false unless (classes = stubs[op.resource])
145
- return false unless (stubs = classes[op.action])
148
+ def stub_for(operation)
149
+ return false unless (classes = stubs[operation.resource])
150
+ return false unless (stubs = classes[operation.action])
146
151
 
147
- accepted_stubs = stubs.select {|stub| stub.accept? op }
152
+ accepted_stubs = stubs.select {|stub| stub.accept?(operation) }
148
153
 
149
154
  if accepted_stubs.size > 1
150
- raise AmbiguousStubError.new stubs: accepted_stubs, operation: op
155
+ raise AmbiguousStubError.new(stubs: accepted_stubs, operation: operation)
151
156
  end
152
157
 
153
158
  accepted_stubs.first
154
159
  end
155
160
 
156
- def stubbed(op)
157
- stub = stub_for op
161
+ def stubbed(operation)
162
+ stub = stub_for(operation)
158
163
  unless stub
159
164
  return false if allow_requests?
160
165
 
161
166
  raise RealRequestsNotAllowedError.new <<~ERROR
162
- No stub found for `#{op.action}' on `#{op.resource.name}' \
163
- with params `#{op.full_params.inspect}', data `#{op.data.inspect}' \
164
- and id `#{op.id}'.
167
+ No stub found for `#{operation.action}' on `#{operation.resource.name}' \
168
+ with params `#{operation.full_params.inspect}', data `#{operation.data.inspect}' \
169
+ and id `#{operation.id}'.
165
170
 
166
171
  Available stubs:
167
172
  #{pretty_print}
168
173
  ERROR
169
174
  end
170
175
 
171
- stub.call op
176
+ stub.call(operation)
172
177
  true
173
178
  end
174
179
 
data/lib/acfs/version.rb CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Acfs
4
4
  module VERSION
5
- MAJOR = 1
6
- MINOR = 6
5
+ MAJOR = 2
6
+ MINOR = 0
7
7
  PATCH = 0
8
8
  STAGE = nil
9
9
 
10
- STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
10
+ STRING = [MAJOR, MINOR, PATCH, STAGE].compact.join('.')
11
11
 
12
12
  def self.to_s
13
13
  STRING
data/lib/acfs/yard.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # YARD macros
3
4
 
4
5
  # @!macro [new] experimental
@@ -20,7 +20,7 @@ describe Acfs::Adapter::Typhoeus do
20
20
  adapter.queue request2
21
21
 
22
22
  expect { adapter.start }.to raise_error(/404-[12]/)
23
- expect { adapter.start }.to_not raise_error
23
+ expect { adapter.start }.not_to raise_error
24
24
  end
25
25
 
26
26
  it 'raises timeout' do
@@ -29,7 +29,7 @@ describe Acfs::Adapter::Typhoeus do
29
29
  request = Acfs::Request.new 'http://example.org'
30
30
  adapter.queue request
31
31
 
32
- expect { adapter.run(request) }.to raise_error(::Acfs::TimeoutError) do |err|
32
+ expect { adapter.run(request) }.to raise_error(Acfs::TimeoutError) do |err|
33
33
  expect(err.message).to eq 'Timeout reached: GET http://example.org'
34
34
  end
35
35
  end
@@ -40,7 +40,7 @@ describe Acfs::Adapter::Typhoeus do
40
40
  request = Acfs::Request.new 'http://should-never-exists.example.org'
41
41
  adapter.queue request
42
42
 
43
- expect { adapter.run(request) }.to raise_error(::Acfs::RequestError) do |err|
43
+ expect { adapter.run(request) }.to raise_error(Acfs::RequestError) do |err|
44
44
  expect(err.message).to eq 'Couldn\'t resolve host name: GET http://should-never-exists.example.org'
45
45
  end
46
46
  end
@@ -48,7 +48,7 @@ describe Acfs::Adapter::Typhoeus do
48
48
  it 'passes arguments to typhoeus hydra' do
49
49
  value = {key: 1, key2: 2}
50
50
 
51
- expect(::Typhoeus::Hydra).to receive(:new).with(value)
51
+ expect(Typhoeus::Hydra).to receive(:new).with(value)
52
52
 
53
53
  described_class.new(**value).send :hydra
54
54
  end
@@ -6,149 +6,174 @@ describe Acfs::Collection do
6
6
  let(:model) { MyUser }
7
7
 
8
8
  describe 'Pagination' do
9
+ subject do
10
+ Acfs.run
11
+ collection
12
+ end
13
+
9
14
  let(:params) { {} }
10
15
  let!(:collection) { model.all params }
11
16
 
12
- subject { Acfs.run; collection }
13
-
14
17
  context 'without explicit page parameter' do
15
18
  before do
16
19
  stub_request(:get, 'http://users.example.org/users')
17
20
  .to_return response([{id: 1, name: 'Anon', age: 12, born_at: 'Berlin'}],
18
21
  headers: {
19
22
  'X-Total-Pages' => '2',
20
- 'X-Total-Count' => '10'
21
- })
23
+ 'X-Total-Count' => '10',
24
+ },)
22
25
  end
23
26
 
24
- its(:total_pages) { should eq 2 }
25
- its(:current_page) { should eq 1 }
26
- its(:total_count) { should eq 10 }
27
+ its(:total_pages) { is_expected.to eq 2 }
28
+ its(:current_page) { is_expected.to eq 1 }
29
+ its(:total_count) { is_expected.to eq 10 }
27
30
  end
28
31
 
29
32
  context 'with page parameter' do
30
33
  let(:params) { {page: 2} }
34
+
31
35
  before do
32
36
  stub_request(:get, 'http://users.example.org/users?page=2')
33
37
  .to_return response([{id: 1, name: 'Anon', age: 12, born_at: 'Berlin'}],
34
38
  headers: {
35
39
  'X-Total-Pages' => '2',
36
- 'X-Total-Count' => '10'
37
- })
40
+ 'X-Total-Count' => '10',
41
+ },)
38
42
  end
39
43
 
40
- its(:total_pages) { should eq 2 }
41
- its(:current_page) { should eq 2 }
42
- its(:total_count) { should eq 10 }
44
+ its(:total_pages) { is_expected.to eq 2 }
45
+ its(:current_page) { is_expected.to eq 2 }
46
+ its(:total_count) { is_expected.to eq 10 }
43
47
  end
44
48
 
45
49
  context 'with non-numerical page parameter' do
46
50
  let(:params) { {page: 'e546f5'} }
51
+
47
52
  before do
48
53
  stub_request(:get, 'http://users.example.org/users?page=e546f5')
49
54
  .to_return response([{id: 1, name: 'Anon', age: 12, born_at: 'Berlin'}],
50
55
  headers: {
51
56
  'X-Total-Pages' => '2',
52
- 'X-Total-Count' => '10'
53
- })
57
+ 'X-Total-Count' => '10',
58
+ },)
54
59
  end
55
60
 
56
- its(:total_pages) { should eq 2 }
57
- its(:current_page) { should eq 'e546f5' }
58
- its(:total_count) { should eq 10 }
61
+ its(:total_pages) { is_expected.to eq 2 }
62
+ its(:current_page) { is_expected.to eq 'e546f5' }
63
+ its(:total_count) { is_expected.to eq 10 }
59
64
  end
60
65
 
61
66
  describe '#next_page' do
67
+ subject(:request_page) do
68
+ Acfs.run
69
+ collection.next_page
70
+ end
71
+
62
72
  before do
63
73
  stub_request(:get, 'http://users.example.org/users')
64
74
  .to_return response([{id: 1, name: 'Anon', age: 12, born_at: 'Berlin'}],
65
75
  headers: {
66
76
  'X-Total-Pages' => '2',
67
- 'Link' => '<http://users.example.org/users?page=2>; rel="next"'
68
- })
77
+ 'Link' => '<http://users.example.org/users?page=2>; rel="next"',
78
+ },)
69
79
  end
80
+
70
81
  let!(:req) do
71
82
  stub_request(:get, 'http://users.example.org/users?page=2').to_return response([])
72
83
  end
73
84
  let!(:collection) { model.all }
74
- subject { Acfs.run; collection.next_page }
75
85
 
76
- it { should be_a Acfs::Collection }
86
+ it { is_expected.to be_a Acfs::Collection }
77
87
 
78
- it 'should have fetched page 2' do
79
- subject
88
+ it 'has fetched page 2' do
89
+ request_page
80
90
  Acfs.run
81
91
  expect(req).to have_been_requested
82
92
  end
83
93
  end
84
94
 
85
95
  describe '#prev_page' do
96
+ subject(:request_page) do
97
+ Acfs.run
98
+ collection.prev_page
99
+ end
100
+
86
101
  before do
87
102
  stub_request(:get, 'http://users.example.org/users?page=2')
88
103
  .to_return response([{id: 2, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
89
104
  headers: {
90
105
  'X-Total-Pages' => '2',
91
- 'Link' => '<http://users.example.org/users>; rel="prev"'
92
- })
106
+ 'Link' => '<http://users.example.org/users>; rel="prev"',
107
+ },)
93
108
  end
109
+
94
110
  let!(:req) do
95
111
  stub_request(:get, 'http://users.example.org/users').to_return response([])
96
112
  end
97
113
  let!(:collection) { model.all page: 2 }
98
- subject { Acfs.run; collection.prev_page }
99
114
 
100
- it { should be_a Acfs::Collection }
115
+ it { is_expected.to be_a Acfs::Collection }
101
116
 
102
- it 'should have fetched page 1' do
103
- subject
117
+ it 'has fetched page 1' do
118
+ request_page
104
119
  Acfs.run
105
120
  expect(req).to have_been_requested
106
121
  end
107
122
  end
108
123
 
109
124
  describe '#first_page' do
125
+ subject(:request_page) do
126
+ Acfs.run
127
+ collection.first_page
128
+ end
129
+
110
130
  before do
111
131
  stub_request(:get, 'http://users.example.org/users?page=2')
112
132
  .to_return response([{id: 2, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
113
133
  headers: {
114
134
  'X-Total-Pages' => '2',
115
- 'Link' => '<http://users.example.org/users>; rel="first"'
116
- })
135
+ 'Link' => '<http://users.example.org/users>; rel="first"',
136
+ },)
117
137
  end
138
+
118
139
  let!(:req) do
119
140
  stub_request(:get, 'http://users.example.org/users').to_return response([])
120
141
  end
121
142
  let!(:collection) { model.all page: 2 }
122
- subject { Acfs.run; collection.first_page }
123
143
 
124
- it { should be_a Acfs::Collection }
144
+ it { is_expected.to be_a Acfs::Collection }
125
145
 
126
- it 'should have fetched page 1' do
127
- subject
146
+ it 'has fetched page 1' do
147
+ request_page
128
148
  Acfs.run
129
149
  expect(req).to have_been_requested
130
150
  end
131
151
  end
132
152
 
133
153
  describe '#last_page' do
154
+ subject(:request_page) do
155
+ Acfs.run
156
+ collection.last_page
157
+ end
158
+
134
159
  before do
135
160
  stub_request(:get, 'http://users.example.org/users?page=2')
136
161
  .to_return response([{id: 2, name: 'Anno', age: 1604, born_at: 'Santa Maria'}],
137
162
  headers: {
138
163
  'X-Total-Pages' => '2',
139
- 'Link' => '<http://users.example.org/users?page=12>; rel="last"'
140
- })
164
+ 'Link' => '<http://users.example.org/users?page=12>; rel="last"',
165
+ },)
141
166
  end
167
+
142
168
  let!(:req) do
143
169
  stub_request(:get, 'http://users.example.org/users?page=12').to_return response([])
144
170
  end
145
171
  let!(:collection) { model.all page: 2 }
146
- subject { Acfs.run; collection.last_page }
147
172
 
148
- it { should be_a Acfs::Collection }
173
+ it { is_expected.to be_a Acfs::Collection }
149
174
 
150
- it 'should have fetched page 1' do
151
- subject
175
+ it 'has fetched page 1' do
176
+ request_page
152
177
  Acfs.run
153
178
  expect(req).to have_been_requested
154
179
  end
@@ -4,11 +4,16 @@ require 'spec_helper'
4
4
 
5
5
  describe Acfs::Configuration do
6
6
  let(:cfg) { Acfs::Configuration.new }
7
- before { @configuration = Acfs::Configuration.current.dup }
8
- after { Acfs::Configuration.set @configuration }
7
+
8
+ around do |example|
9
+ configuration = Acfs::Configuration.current.dup
10
+ example.run
11
+ ensure
12
+ Acfs::Configuration.set(configuration)
13
+ end
9
14
 
10
15
  describe 'Acfs.configure' do
11
- it 'should invoke configure on current configuration' do
16
+ it 'invokes configure on current configuration' do
12
17
  expect(Acfs::Configuration.current).to receive(:configure).once.and_call_original
13
18
 
14
19
  Acfs.configure do |c|
@@ -18,26 +23,31 @@ describe Acfs::Configuration do
18
23
  end
19
24
 
20
25
  describe '.load' do
21
- it 'should be able to load YAML' do
26
+ it 'is able to load YAML' do
22
27
  cfg.configure do
23
28
  load 'spec/fixtures/config.yml'
24
29
  end
25
30
 
26
- expect(cfg.locate(UserService).to_s).to be == 'http://localhost:3001/'
27
- expect(cfg.locate(CommentService).to_s).to be == 'http://localhost:3002/'
31
+ expect(cfg.locate(UserService).to_s).to eq 'http://localhost:3001/'
32
+ expect(cfg.locate(CommentService).to_s).to eq 'http://localhost:3002/'
28
33
  end
29
34
 
30
35
  context 'with RACK_ENV' do
31
- before { @env = ENV['RACK_ENV']; ENV['RACK_ENV'] = 'production' }
32
- after { ENV['RACK_ENV'] = @env }
36
+ around do |example|
37
+ env = ENV.fetch('RACK_ENV', nil)
38
+ ENV['RACK_ENV'] = 'production'
39
+ example.run
40
+ ensure
41
+ ENV['RACK_ENV'] = env
42
+ end
33
43
 
34
- it 'should load ENV block' do
44
+ it 'loads ENV block' do
35
45
  cfg.configure do
36
46
  load 'spec/fixtures/config.yml'
37
47
  end
38
48
 
39
- expect(cfg.locate(UserService).to_s).to be == 'http://user.example.org/'
40
- expect(cfg.locate(CommentService).to_s).to be == 'http://comment.example.org/'
49
+ expect(cfg.locate(UserService).to_s).to eq 'http://user.example.org/'
50
+ expect(cfg.locate(CommentService).to_s).to eq 'http://comment.example.org/'
41
51
  end
42
52
  end
43
53
  end
@@ -45,7 +55,7 @@ describe Acfs::Configuration do
45
55
  describe '#adapter' do
46
56
  let(:object) { Object.new }
47
57
 
48
- it 'should be a accessor' do
58
+ it 'is a accessor' do
49
59
  cfg.adapter = object
50
60
  expect(cfg.adapter).to eq object
51
61
  end
@@ -12,11 +12,11 @@ class NotificationCollector
12
12
  end
13
13
  end
14
14
 
15
- describe ::Acfs::Global do
16
- let(:adapter) { ::NullAdapter.new }
15
+ describe Acfs::Global do
16
+ let(:adapter) { NullAdapter.new }
17
17
  let(:runner) { double 'runner' }
18
18
  let(:collector) { NotificationCollector.new }
19
- let(:acfs) { Object.new.tap {|o| o.extend ::Acfs::Global } }
19
+ let(:acfs) { Object.new.tap {|o| o.extend Acfs::Global } }
20
20
 
21
21
  describe 'instrumentation' do
22
22
  before do
@@ -26,9 +26,10 @@ describe ::Acfs::Global do
26
26
 
27
27
  describe '#run' do
28
28
  before do
29
- ::ActiveSupport::Notifications.subscribe 'acfs.run', collector
29
+ ActiveSupport::Notifications.subscribe 'acfs.run', collector
30
30
  end
31
- it 'should trigger event' do
31
+
32
+ it 'triggers event' do
32
33
  Acfs.run
33
34
  expect(collector.events).to have(1).items
34
35
  end
@@ -36,9 +37,10 @@ describe ::Acfs::Global do
36
37
 
37
38
  describe '#reset' do
38
39
  before do
39
- ::ActiveSupport::Notifications.subscribe 'acfs.reset', collector
40
+ ActiveSupport::Notifications.subscribe 'acfs.reset', collector
40
41
  end
41
- it 'should trigger event' do
42
+
43
+ it 'triggers event' do
42
44
  Acfs.reset
43
45
  expect(collector.events).to have(1).items
44
46
  end
@@ -50,11 +52,11 @@ describe ::Acfs::Global do
50
52
  stub_request(:get, %r{http://users.example.org/users/\d+}).to_return(
51
53
  status: 200,
52
54
  body: '{}',
53
- headers: {'Content-Type' => 'application/json'}
55
+ headers: {'Content-Type' => 'application/json'},
54
56
  )
55
57
  end
56
58
 
57
- it 'should invoke when both resources' do
59
+ it 'invokes when both resources' do
58
60
  user1 = MyUser.find 1
59
61
  user2 = MyUser.find 2
60
62
 
@@ -64,7 +66,7 @@ describe ::Acfs::Global do
64
66
  end.to yield_with_args(user1, user2)
65
67
  end
66
68
 
67
- it 'should invoke when both resources when loaded' do
69
+ it 'invokes when both resources when loaded' do
68
70
  user1 = MyUser.find 1
69
71
  user2 = MyUser.find 2
70
72
 
@@ -82,7 +84,7 @@ describe ::Acfs::Global do
82
84
  .to_return(
83
85
  status: 200,
84
86
  body: '{}',
85
- headers: {'Content-Type' => 'application/json'}
87
+ headers: {'Content-Type' => 'application/json'},
86
88
  )
87
89
  end
88
90
 
@@ -125,7 +127,7 @@ describe ::Acfs::Global do
125
127
  runner1 = Thread.new { acfs.runner }.value
126
128
  runner2 = Thread.new { acfs.runner }.value
127
129
 
128
- expect(runner1).to_not equal runner2
130
+ expect(runner1).not_to equal runner2
129
131
  end
130
132
 
131
133
  it 'uses configurated adapter' do
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe ::Acfs::Location do
5
+ describe Acfs::Location do
6
6
  let(:location) { described_class.new(uri, args) }
7
7
  let(:uri) { 'http://localhost/users/:id' }
8
8
  let(:args) { {'id' => 4} }
@@ -16,15 +16,15 @@ describe Acfs::Middleware::JSON do
16
16
 
17
17
  describe 'encode' do
18
18
  context 'with not serialized request' do
19
- it 'should set Content-Type' do
19
+ it 'sets Content-Type' do
20
20
  expect(request.headers['Content-Type']).to eq 'application/json'
21
21
  end
22
22
 
23
- it 'should append Accept header' do
23
+ it 'appends Accept header' do
24
24
  expect(request.headers['Accept']).to eq 'application/json;q=1'
25
25
  end
26
26
 
27
- it 'should serialize data to JSON' do
27
+ it 'serializes data to JSON' do
28
28
  expect(JSON.parse(request.body)).to eq data.map(&:stringify_keys)
29
29
  end
30
30
  end
@@ -38,7 +38,7 @@ describe Acfs::Middleware::JSON do
38
38
  end.new
39
39
  end
40
40
 
41
- it 'should serialize data with #to_json' do
41
+ it 'serializes data with #to_json' do
42
42
  expect(JSON.parse(request.body)).to eq 'a' => 1, 'b' => 2
43
43
  end
44
44
  end
@@ -49,10 +49,10 @@ describe Acfs::Middleware::JSON do
49
49
  let(:headers) { {'Content-Type' => 'application/json; charset=utf-8'} }
50
50
  let(:body) { data.to_json }
51
51
 
52
- it 'should decode body data' do
52
+ it 'decodes body data' do
53
53
  request.complete! response
54
54
 
55
- expect(response.data).to be == data.map(&:stringify_keys)
55
+ expect(response.data).to eq data.map(&:stringify_keys)
56
56
  end
57
57
  end
58
58
 
@@ -60,8 +60,8 @@ describe Acfs::Middleware::JSON do
60
60
  let(:headers) { {'Content-Type' => 'application/json'} }
61
61
  let(:body) { data.to_json[4..-4] }
62
62
 
63
- it 'should raise an error' do
64
- expect { request.complete! response }.to raise_error(::JSON::ParserError)
63
+ it 'raises an error' do
64
+ expect { request.complete! response }.to raise_error(JSON::ParserError)
65
65
  end
66
66
  end
67
67
 
@@ -69,7 +69,7 @@ describe Acfs::Middleware::JSON do
69
69
  let(:headers) { {'Content-Type' => 'application/text'} }
70
70
  let(:body) { data.to_json }
71
71
 
72
- it 'should not decode non-JSON encoded responses' do
72
+ it 'does not decode non-JSON encoded responses' do
73
73
  request.complete! response
74
74
 
75
75
  expect(response.data).to be_nil