acfs 1.6.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +144 -115
- data/README.md +33 -41
- data/acfs.gemspec +9 -10
- data/lib/acfs/adapter/typhoeus.rb +6 -4
- data/lib/acfs/collections/paginatable.rb +11 -11
- data/lib/acfs/configuration.rb +13 -3
- data/lib/acfs/errors.rb +7 -7
- data/lib/acfs/global.rb +4 -4
- data/lib/acfs/location.rb +2 -2
- data/lib/acfs/operation.rb +1 -1
- data/lib/acfs/request/callbacks.rb +1 -1
- data/lib/acfs/request.rb +1 -1
- data/lib/acfs/resource/attributes/uuid.rb +2 -2
- data/lib/acfs/resource/attributes.rb +1 -1
- data/lib/acfs/resource/dirty.rb +1 -1
- data/lib/acfs/resource/locatable.rb +2 -2
- data/lib/acfs/resource/operational.rb +4 -4
- data/lib/acfs/resource/query_methods.rb +5 -5
- data/lib/acfs/response/status.rb +1 -1
- data/lib/acfs/runner.rb +15 -15
- data/lib/acfs/service/middleware.rb +2 -2
- data/lib/acfs/singleton_resource.rb +2 -2
- data/lib/acfs/stub.rb +35 -30
- data/lib/acfs/version.rb +3 -3
- data/lib/acfs/yard.rb +1 -0
- data/spec/acfs/adapter/typhoeus_spec.rb +4 -4
- data/spec/acfs/collection_spec.rb +66 -41
- data/spec/acfs/configuration_spec.rb +22 -12
- data/spec/acfs/global_spec.rb +14 -12
- data/spec/acfs/location_spec.rb +1 -1
- data/spec/acfs/middleware/json_spec.rb +9 -9
- data/spec/acfs/middleware/{msgpack_spec.rb → message_pack_spec.rb} +7 -7
- data/spec/acfs/operation_spec.rb +4 -3
- data/spec/acfs/request/callbacks_spec.rb +19 -10
- data/spec/acfs/request_spec.rb +15 -19
- data/spec/acfs/resource/attributes/boolean_spec.rb +32 -32
- data/spec/acfs/resource/attributes/date_time_spec.rb +17 -9
- data/spec/acfs/resource/attributes/dict_spec.rb +16 -10
- data/spec/acfs/resource/attributes/float_spec.rb +21 -11
- data/spec/acfs/resource/attributes/integer_spec.rb +11 -6
- data/spec/acfs/resource/attributes/list_spec.rb +13 -8
- data/spec/acfs/resource/attributes/uuid_spec.rb +14 -8
- data/spec/acfs/resource/attributes_spec.rb +33 -32
- data/spec/acfs/resource/dirty_spec.rb +7 -4
- data/spec/acfs/resource/initialization_spec.rb +4 -5
- data/spec/acfs/resource/loadable_spec.rb +3 -1
- data/spec/acfs/resource/locatable_spec.rb +24 -18
- data/spec/acfs/resource/{persistance_spec.rb → persistence_spec.rb} +119 -87
- data/spec/acfs/resource/query_methods_spec.rb +144 -111
- data/spec/acfs/resource/validation_spec.rb +34 -27
- data/spec/acfs/response/formats_spec.rb +8 -8
- data/spec/acfs/response/status_spec.rb +16 -9
- data/spec/acfs/runner_spec.rb +22 -20
- data/spec/acfs/service/middleware_spec.rb +3 -3
- data/spec/acfs/service_spec.rb +5 -4
- data/spec/acfs/singleton_resource_spec.rb +2 -1
- data/spec/acfs/stub_spec.rb +64 -65
- data/spec/acfs_spec.rb +112 -94
- data/spec/spec_helper.rb +10 -6
- data/spec/support/hash.rb +1 -1
- data/spec/support/response.rb +2 -2
- data/spec/support/service.rb +1 -1
- data/spec/support/shared/find_callbacks.rb +14 -10
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +23 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/CHANGELOG.md +205 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/README.rdoc +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +67 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/CHANGELOG.md +110 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/README.rdoc +266 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/CHANGELOG.md +157 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/README.md +243 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/appraisal.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md +48 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/README.md +138 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/benchmark.gemspec +32 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/LICENSE +56 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/bigdecimal.gemspec +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/README.md +167 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/connection_pool.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/README.md +43 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/License.md +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +84 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/drb.gemspec +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md +118 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/CHANGELOG.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE.SPECS +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/README.md +137 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/ffi.gemspec +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/README.md +298 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/changelog.md +119 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/README.md +127 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/README.md +195 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/json.gemspec +64 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/CHANGELOG.md +591 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/MIT-LICENSE.txt +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/README.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/CHANGELOG.md +275 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE.md +9 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/README.md +293 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/CHANGELOG.md +491 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/README.md +222 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/CHANGELOG.md +998 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/README.md +328 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/license.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/readme.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/README.md +91 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/rake.gemspec +101 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/README.md +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/LICENSE.md +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/README.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/Changelog.md +68 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/README.md +76 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/rspec-collection_matchers.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/Changelog.md +2415 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/LICENSE.md +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/README.md +389 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/Changelog.md +1352 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/README.md +326 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/Changelog.md +73 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/rspec-its.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/Changelog.md +1299 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/README.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/Changelog.md +408 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/LICENSE.md +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/README.md +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/README.md +45 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/thor.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/LICENSE +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md +588 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
- data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.2/README.md +55 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/CHANGELOG.md +2104 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/README.md +1222 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.1.gemspec +36 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.1.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activemodel-8.0.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.1.gemspec +38 -0
- data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/appraisal-2.5.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.1.9.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crack-1.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +37 -0
- data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ethon-0.16.0.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ffi-1.17.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/hashdiff-1.1.2.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/json-2.9.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.4.0/specifications/logger-1.6.5.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/multi_json-1.15.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-3.1.8.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.0.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.2.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rexml-3.4.0.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-collection_matchers-1.2.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-its-2.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.2.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/thor-1.3.2.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/typhoeus-1.4.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.2.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/webmock-3.24.0.gemspec +45 -0
- metadata +208 -70
@@ -16,23 +16,23 @@ describe Acfs::Middleware::MessagePack do
|
|
16
16
|
|
17
17
|
describe 'encode' do
|
18
18
|
context 'with not serialized request' do
|
19
|
-
it '
|
19
|
+
it 'sets Content-Type' do
|
20
20
|
expect(request.headers['Content-Type']).to eq 'application/x-msgpack'
|
21
21
|
end
|
22
22
|
|
23
|
-
it '
|
23
|
+
it 'appends Accept header' do
|
24
24
|
expect(request.headers['Accept']).to eq 'application/x-msgpack;q=1'
|
25
25
|
end
|
26
26
|
|
27
27
|
context 'with JSON chained' do
|
28
28
|
let(:decoder) { Acfs::Middleware::JSON.new super(), q: 0.5 }
|
29
29
|
|
30
|
-
it '
|
30
|
+
it 'appends to Accept header' do
|
31
31
|
expect(request.headers['Accept']).to eq 'application/json;q=0.5,application/x-msgpack;q=1'
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
it '
|
35
|
+
it 'serializes data to MessagePack' do
|
36
36
|
expect(MessagePack.unpack(request.body)).to eq data.map(&:stringify_keys)
|
37
37
|
end
|
38
38
|
end
|
@@ -42,10 +42,10 @@ describe Acfs::Middleware::MessagePack do
|
|
42
42
|
let(:headers) { {'Content-Type' => 'application/x-msgpack'} }
|
43
43
|
let(:body) { MessagePack.pack data }
|
44
44
|
|
45
|
-
it '
|
45
|
+
it 'decodes body data' do
|
46
46
|
request.complete! response
|
47
47
|
|
48
|
-
expect(response.data).to
|
48
|
+
expect(response.data).to eq data.map(&:stringify_keys)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -53,7 +53,7 @@ describe Acfs::Middleware::MessagePack do
|
|
53
53
|
let(:headers) { {'Content-Type' => 'application/text'} }
|
54
54
|
let(:body) { data.to_json }
|
55
55
|
|
56
|
-
it '
|
56
|
+
it 'does not decode non-MessagePack encoded responses' do
|
57
57
|
request.complete! response
|
58
58
|
|
59
59
|
expect(response.data).to be_nil
|
data/spec/acfs/operation_spec.rb
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe Acfs::Operation do
|
6
6
|
let(:operation) { described_class.new MyUser, :read, params: {id: 0} }
|
7
7
|
|
8
|
-
|
8
|
+
describe '#request' do
|
9
9
|
subject { operation.request }
|
10
|
-
|
10
|
+
|
11
|
+
its(:operation) { is_expected.to eq operation }
|
11
12
|
end
|
12
13
|
end
|
@@ -7,42 +7,51 @@ describe Acfs::Request::Callbacks do
|
|
7
7
|
let(:request) { Acfs::Request.new('fubar') }
|
8
8
|
|
9
9
|
describe '#on_complete' do
|
10
|
-
it '
|
10
|
+
it 'stores a given callback' do
|
11
11
|
request.on_complete(&callback)
|
12
12
|
|
13
13
|
expect(request.callbacks).to have(1).item
|
14
|
-
expect(request.callbacks[0]).to
|
14
|
+
expect(request.callbacks[0]).to eq callback
|
15
15
|
end
|
16
16
|
|
17
|
-
it '
|
17
|
+
it 'stores multiple callback' do
|
18
18
|
request.on_complete {|_res| 'abc' }
|
19
19
|
request.on_complete(&callback)
|
20
20
|
|
21
21
|
expect(request.callbacks).to have(2).item
|
22
|
-
expect(request.callbacks[0]).to
|
22
|
+
expect(request.callbacks[0]).to eq callback
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe '#complete!' do
|
27
27
|
let(:response) { Acfs::Response.new(request) }
|
28
28
|
|
29
|
-
it '
|
29
|
+
it 'triggers registered callbacks with given response' do
|
30
30
|
expect(callback).to receive(:call).with(response, kind_of(Proc))
|
31
31
|
|
32
32
|
request.on_complete(&callback)
|
33
33
|
request.complete! response
|
34
34
|
end
|
35
35
|
|
36
|
-
it '
|
36
|
+
it 'triggers multiple callback in reverted insertion order' do
|
37
37
|
check = []
|
38
38
|
|
39
|
-
request.on_complete
|
40
|
-
|
41
|
-
|
39
|
+
request.on_complete do |res, nxt|
|
40
|
+
check << 1
|
41
|
+
nxt.call res
|
42
|
+
end
|
43
|
+
request.on_complete do |res, nxt|
|
44
|
+
check << 2
|
45
|
+
nxt.call res
|
46
|
+
end
|
47
|
+
request.on_complete do |res, nxt|
|
48
|
+
check << 3
|
49
|
+
nxt.call res
|
50
|
+
end
|
42
51
|
|
43
52
|
request.complete! response
|
44
53
|
|
45
|
-
expect(check).to
|
54
|
+
expect(check).to eq [3, 2, 1]
|
46
55
|
end
|
47
56
|
end
|
48
57
|
end
|
data/spec/acfs/request_spec.rb
CHANGED
@@ -12,15 +12,15 @@ describe Acfs::Request do
|
|
12
12
|
let(:request) { Acfs::Request.new(url, **options) }
|
13
13
|
|
14
14
|
describe '#url' do
|
15
|
-
it '
|
16
|
-
expect(request.url).to
|
15
|
+
it 'returns request URL' do
|
16
|
+
expect(request.url).to eq url
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'with parameters' do
|
20
20
|
let(:params) { {id: 10} }
|
21
21
|
|
22
|
-
it '
|
23
|
-
expect(request.url).to
|
22
|
+
it 'returns URL without query' do
|
23
|
+
expect(request.url).to eq url.to_s
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -28,8 +28,8 @@ describe Acfs::Request do
|
|
28
28
|
describe '#headers' do
|
29
29
|
let(:headers) { {'Accept' => 'application/json'} }
|
30
30
|
|
31
|
-
it '
|
32
|
-
expect(request.headers).to
|
31
|
+
it 'returns request headers' do
|
32
|
+
expect(request.headers).to eq headers
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -37,43 +37,39 @@ describe Acfs::Request do
|
|
37
37
|
context 'when nil given' do
|
38
38
|
let(:method) { nil }
|
39
39
|
|
40
|
-
it '
|
41
|
-
expect(request.method).to
|
40
|
+
it 'defaults to :get' do
|
41
|
+
expect(request.method).to eq :get
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
it '
|
46
|
-
expect(request.method).to
|
45
|
+
it 'returns request method' do
|
46
|
+
expect(request.method).to eq method
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
describe '#params' do
|
51
51
|
let(:params) { {id: 10} }
|
52
52
|
|
53
|
-
it '
|
54
|
-
expect(request.params).to
|
53
|
+
it 'returns request headers' do
|
54
|
+
expect(request.params).to eq params
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
describe '#data' do
|
59
59
|
let(:data) { {id: 10, name: 'Anon'} }
|
60
60
|
|
61
|
-
it '
|
62
|
-
expect(request.data).to
|
61
|
+
it 'returns request data' do
|
62
|
+
expect(request.data).to eq data
|
63
63
|
end
|
64
|
-
end
|
65
64
|
|
66
|
-
describe '#data' do
|
67
65
|
context 'with data' do
|
68
|
-
let(:data) { {id: 10, name: 'Anon'} }
|
69
|
-
|
70
66
|
it { expect(request).to be_data }
|
71
67
|
end
|
72
68
|
|
73
69
|
context 'without data' do
|
74
70
|
let(:data) { nil }
|
75
71
|
|
76
|
-
it { expect(request).
|
72
|
+
it { expect(request).not_to be_data }
|
77
73
|
end
|
78
74
|
end
|
79
75
|
end
|
@@ -3,56 +3,56 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Acfs::Resource::Attributes::Boolean do
|
6
|
-
subject { Acfs::Resource::Attributes::Boolean.new }
|
6
|
+
subject(:type) { Acfs::Resource::Attributes::Boolean.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
9
|
it 'casts nil' do
|
10
|
-
expect(
|
10
|
+
expect(type.cast(nil)).to be_nil
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'casts empty string to false' do
|
14
|
-
expect(
|
14
|
+
expect(type.cast('')).to be_nil
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'casts blank string to false' do
|
18
|
-
expect(
|
18
|
+
expect(type.cast(" \t")).to be_nil
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'preserves boolean values' do
|
22
|
-
expect(
|
23
|
-
expect(
|
22
|
+
expect(type.cast(false)).to be false
|
23
|
+
expect(type.cast(true)).to be true
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'casts falsy values to false' do
|
27
|
-
expect(
|
28
|
-
expect(
|
29
|
-
expect(
|
30
|
-
expect(
|
31
|
-
expect(
|
32
|
-
expect(
|
33
|
-
expect(
|
34
|
-
expect(
|
35
|
-
expect(
|
36
|
-
expect(
|
37
|
-
expect(
|
27
|
+
expect(type.cast(false)).to be false
|
28
|
+
expect(type.cast(0)).to be false
|
29
|
+
expect(type.cast('0')).to be false
|
30
|
+
expect(type.cast('no')).to be false
|
31
|
+
expect(type.cast('NO')).to be false
|
32
|
+
expect(type.cast('off')).to be false
|
33
|
+
expect(type.cast('OFF')).to be false
|
34
|
+
expect(type.cast('false')).to be false
|
35
|
+
expect(type.cast('FALSE')).to be false
|
36
|
+
expect(type.cast('f')).to be false
|
37
|
+
expect(type.cast('F')).to be false
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'casts any other value to true' do
|
41
|
-
expect(
|
42
|
-
expect(
|
43
|
-
expect(
|
44
|
-
expect(
|
45
|
-
expect(
|
46
|
-
expect(
|
47
|
-
expect(
|
48
|
-
expect(
|
49
|
-
expect(
|
50
|
-
expect(
|
51
|
-
expect(
|
52
|
-
|
53
|
-
expect(
|
54
|
-
expect(
|
55
|
-
expect(
|
41
|
+
expect(type.cast(true)).to be true
|
42
|
+
expect(type.cast(1)).to be true
|
43
|
+
expect(type.cast('1')).to be true
|
44
|
+
expect(type.cast('yes')).to be true
|
45
|
+
expect(type.cast('YES')).to be true
|
46
|
+
expect(type.cast('on')).to be true
|
47
|
+
expect(type.cast('ON')).to be true
|
48
|
+
expect(type.cast('true')).to be true
|
49
|
+
expect(type.cast('TRUE')).to be true
|
50
|
+
expect(type.cast('t')).to be true
|
51
|
+
expect(type.cast('T')).to be true
|
52
|
+
|
53
|
+
expect(type.cast(2)).to be true
|
54
|
+
expect(type.cast('wrong')).to be true
|
55
|
+
expect(type.cast('random')).to be true
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -6,46 +6,54 @@ describe Acfs::Resource::Attributes::DateTime do
|
|
6
6
|
let(:type) { Acfs::Resource::Attributes::DateTime.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
|
-
subject {
|
9
|
+
subject(:cast) { type.cast value }
|
10
10
|
|
11
11
|
context 'with nil' do
|
12
12
|
let(:value) { nil }
|
13
|
-
|
13
|
+
|
14
|
+
it { expect(cast).to be_nil }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with empty string' do
|
17
18
|
let(:value) { '' }
|
18
|
-
|
19
|
+
|
20
|
+
it { expect(cast).to be_nil }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'with blank string' do
|
22
24
|
let(:value) { " \t" }
|
23
|
-
|
25
|
+
|
26
|
+
it { expect(cast).to be_nil }
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'with DateTime' do
|
27
30
|
let(:value) { DateTime.now }
|
28
|
-
|
31
|
+
|
32
|
+
it { expect(cast).to eq value }
|
29
33
|
end
|
30
34
|
|
31
35
|
context 'with Time' do
|
32
36
|
let(:value) { Time.now }
|
33
|
-
|
37
|
+
|
38
|
+
it { expect(cast).to eq value.to_datetime }
|
34
39
|
end
|
35
40
|
|
36
41
|
context 'with Date' do
|
37
42
|
let(:value) { Date.today }
|
38
|
-
|
43
|
+
|
44
|
+
it { expect(cast).to eq value.to_datetime }
|
39
45
|
end
|
40
46
|
|
41
47
|
context 'with ISO8601' do
|
42
48
|
let(:value) { DateTime.now.iso8601 }
|
43
|
-
|
49
|
+
|
50
|
+
it { expect(cast.iso8601).to eq value }
|
44
51
|
end
|
45
52
|
|
46
53
|
context 'with invalid string' do
|
47
54
|
let(:value) { 'qwe123' }
|
48
|
-
|
55
|
+
|
56
|
+
it { expect { cast }.to raise_error ArgumentError }
|
49
57
|
end
|
50
58
|
end
|
51
59
|
end
|
@@ -6,31 +6,36 @@ describe Acfs::Resource::Attributes::Dict do
|
|
6
6
|
let(:type) { Acfs::Resource::Attributes::Dict.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
|
-
subject {
|
9
|
+
subject(:cast) { type.cast value }
|
10
10
|
|
11
11
|
context 'with nil' do
|
12
12
|
let(:value) { nil }
|
13
|
-
|
13
|
+
|
14
|
+
it { expect(cast).to be_nil }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with blank string (I)' do
|
17
18
|
let(:value) { '' }
|
18
|
-
|
19
|
+
|
20
|
+
it { expect(cast).to eq({}) }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'with blank string (II)' do
|
22
24
|
let(:value) { " \t" }
|
23
|
-
|
25
|
+
|
26
|
+
it { expect(cast).to eq({}) }
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'with hash' do
|
27
30
|
let(:value) { {3 => true, abc: 4} }
|
28
|
-
|
31
|
+
|
32
|
+
it { expect(cast).to eq value }
|
29
33
|
end
|
30
34
|
|
31
35
|
context 'with non hashable object' do
|
32
36
|
let(:value) { Object.new }
|
33
|
-
|
37
|
+
|
38
|
+
it { expect { cast }.to raise_error TypeError }
|
34
39
|
end
|
35
40
|
|
36
41
|
context 'with hashable object (I)' do
|
@@ -42,7 +47,7 @@ describe Acfs::Resource::Attributes::Dict do
|
|
42
47
|
end.new
|
43
48
|
end
|
44
49
|
|
45
|
-
it { expect(
|
50
|
+
it { expect(cast).to eq id: value.object_id }
|
46
51
|
end
|
47
52
|
|
48
53
|
context 'with hashable object (II)' do
|
@@ -54,7 +59,7 @@ describe Acfs::Resource::Attributes::Dict do
|
|
54
59
|
end.new
|
55
60
|
end
|
56
61
|
|
57
|
-
it { expect(
|
62
|
+
it { expect(cast).to eq id: value.object_id }
|
58
63
|
end
|
59
64
|
|
60
65
|
context 'with serializable object' do
|
@@ -66,12 +71,13 @@ describe Acfs::Resource::Attributes::Dict do
|
|
66
71
|
end.new
|
67
72
|
end
|
68
73
|
|
69
|
-
it { expect(
|
74
|
+
it { expect(cast).to eq id: value.object_id }
|
70
75
|
end
|
71
76
|
|
72
77
|
context 'with hash subclass object' do
|
73
78
|
let(:value) { HashWithIndifferentAccess.new test: :foo }
|
74
|
-
|
79
|
+
|
80
|
+
it { expect(cast).to be value }
|
75
81
|
end
|
76
82
|
end
|
77
83
|
end
|
@@ -6,56 +6,66 @@ describe Acfs::Resource::Attributes::Float do
|
|
6
6
|
let(:type) { Acfs::Resource::Attributes::Float.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
|
-
subject {
|
9
|
+
subject(:cast) { type.cast value }
|
10
10
|
|
11
11
|
context 'with nil' do
|
12
12
|
let(:value) { nil }
|
13
|
-
|
13
|
+
|
14
|
+
it { expect(cast).to be_nil }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with blank string (I)' do
|
17
18
|
let(:value) { '' }
|
18
|
-
|
19
|
+
|
20
|
+
it { expect(cast).to eq 0.0 }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'with blank string (II)' do
|
22
24
|
let(:value) { " \t" }
|
23
|
-
|
25
|
+
|
26
|
+
it { expect(cast).to eq 0.0 }
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'with float' do
|
27
30
|
let(:value) { 1.7 }
|
28
|
-
|
31
|
+
|
32
|
+
it { expect(cast).to eq 1.7 }
|
29
33
|
end
|
30
34
|
|
31
35
|
context 'with Infinity' do
|
32
36
|
let(:value) { 'Infinity' }
|
33
|
-
|
37
|
+
|
38
|
+
it { expect(cast).to eq Float::INFINITY }
|
34
39
|
end
|
35
40
|
|
36
41
|
context 'with -Infinity' do
|
37
42
|
let(:value) { '-Infinity' }
|
38
|
-
|
43
|
+
|
44
|
+
it { expect(cast).to eq(-Float::INFINITY) }
|
39
45
|
end
|
40
46
|
|
41
47
|
context 'with NaN' do
|
42
48
|
let(:value) { 'NaN' }
|
43
|
-
|
49
|
+
|
50
|
+
it { expect(cast).to be_nan }
|
44
51
|
end
|
45
52
|
|
46
53
|
context 'with fixnum' do
|
47
54
|
let(:value) { 1 }
|
48
|
-
|
55
|
+
|
56
|
+
it { expect(cast).to eq 1.0 }
|
49
57
|
end
|
50
58
|
|
51
59
|
context 'with valid string' do
|
52
60
|
let(:value) { '1.7' }
|
53
|
-
|
61
|
+
|
62
|
+
it { expect(cast).to eq 1.7 }
|
54
63
|
end
|
55
64
|
|
56
65
|
context 'with invalid string (I)' do
|
57
66
|
let(:value) { '1.7a' }
|
58
|
-
|
67
|
+
|
68
|
+
it { expect { cast }.to raise_error ArgumentError }
|
59
69
|
end
|
60
70
|
end
|
61
71
|
end
|
@@ -6,31 +6,36 @@ describe Acfs::Resource::Attributes::Integer do
|
|
6
6
|
let(:type) { Acfs::Resource::Attributes::Integer.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
|
-
subject {
|
9
|
+
subject(:cast) { type.cast value }
|
10
10
|
|
11
11
|
context 'with nil' do
|
12
12
|
let(:value) { nil }
|
13
|
-
|
13
|
+
|
14
|
+
it { expect(cast).to be_nil }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with empty string' do
|
17
18
|
let(:value) { '' }
|
18
|
-
|
19
|
+
|
20
|
+
it { expect(cast).to eq 0 }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'with blank string' do
|
22
24
|
let(:value) { " \t" }
|
23
|
-
|
25
|
+
|
26
|
+
it { expect(cast).to eq 0 }
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'with string' do
|
27
30
|
let(:value) { '123' }
|
28
|
-
|
31
|
+
|
32
|
+
it { expect(cast).to eq 123 }
|
29
33
|
end
|
30
34
|
|
31
35
|
context 'with invalid string' do
|
32
36
|
let(:value) { '123a' }
|
33
|
-
|
37
|
+
|
38
|
+
it { expect { cast }.to raise_error ArgumentError }
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
@@ -6,26 +6,30 @@ describe Acfs::Resource::Attributes::List do
|
|
6
6
|
let(:type) { Acfs::Resource::Attributes::List.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
|
-
subject { -> { type.cast value } }
|
9
|
+
subject(:cast) { -> { type.cast value } }
|
10
10
|
|
11
11
|
context 'with nil' do
|
12
12
|
let(:value) { nil }
|
13
|
-
|
13
|
+
|
14
|
+
it { expect(cast.call).to be_nil }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with blank string (I)' do
|
17
18
|
let(:value) { '' }
|
18
|
-
|
19
|
+
|
20
|
+
it { expect(cast.call).to eq [] }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'with blank string (II)' do
|
22
24
|
let(:value) { " \t" }
|
23
|
-
|
25
|
+
|
26
|
+
it { expect(cast.call).to eq [] }
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'with array' do
|
27
30
|
let(:value) { %w[abc cde efg] }
|
28
|
-
|
31
|
+
|
32
|
+
it { expect(cast.call).to eq value }
|
29
33
|
end
|
30
34
|
|
31
35
|
context 'with convertable object (I)' do
|
@@ -37,7 +41,7 @@ describe Acfs::Resource::Attributes::List do
|
|
37
41
|
end.new
|
38
42
|
end
|
39
43
|
|
40
|
-
it { expect(
|
44
|
+
it { expect(cast.call).to eq [1, 2, 3] }
|
41
45
|
end
|
42
46
|
|
43
47
|
context 'with convertable object (II)' do
|
@@ -49,12 +53,13 @@ describe Acfs::Resource::Attributes::List do
|
|
49
53
|
end.new
|
50
54
|
end
|
51
55
|
|
52
|
-
it { expect(
|
56
|
+
it { expect(cast.call).to eq [1, 2, 3] }
|
53
57
|
end
|
54
58
|
|
55
59
|
context 'with non castable object' do
|
56
60
|
let(:value) { Object.new }
|
57
|
-
|
61
|
+
|
62
|
+
it { expect(cast.call).to eq [value] }
|
58
63
|
end
|
59
64
|
end
|
60
65
|
end
|
@@ -6,37 +6,43 @@ describe Acfs::Resource::Attributes::UUID do
|
|
6
6
|
let(:type) { Acfs::Resource::Attributes::UUID.new }
|
7
7
|
|
8
8
|
describe '#cast' do
|
9
|
-
subject {
|
9
|
+
subject(:cast) { type.cast(value) }
|
10
10
|
|
11
11
|
context 'with nil' do
|
12
12
|
let(:value) { nil }
|
13
|
-
|
13
|
+
|
14
|
+
it { expect(cast).to be_nil }
|
14
15
|
end
|
15
16
|
|
16
17
|
context 'with empty string' do
|
17
18
|
let(:value) { '' }
|
18
|
-
|
19
|
+
|
20
|
+
it { expect(cast).to be_nil }
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'with blank string' do
|
22
24
|
let(:value) { " \t" }
|
23
|
-
|
25
|
+
|
26
|
+
it { expect(cast).to be_nil }
|
24
27
|
end
|
25
28
|
|
26
29
|
context 'with string UUID' do
|
27
30
|
let(:value) { '450b7a40-94ad-11e3-baa8-0800200c9a66' }
|
28
|
-
|
29
|
-
it { expect(
|
31
|
+
|
32
|
+
it { expect(cast).to be_a String }
|
33
|
+
it { expect(cast).to eq value }
|
30
34
|
end
|
31
35
|
|
32
36
|
context 'with invalid string' do
|
33
37
|
let(:value) { 'invalid string' }
|
34
|
-
|
38
|
+
|
39
|
+
it { expect { cast }.to raise_error TypeError, /invalid UUID/i }
|
35
40
|
end
|
36
41
|
|
37
42
|
context 'with invalid UUID' do
|
38
43
|
let(:value) { 'xxxxxxxx-yyyy-11e3-baa8-0800200c9a66' }
|
39
|
-
|
44
|
+
|
45
|
+
it { expect { cast }.to raise_error TypeError, /invalid UUID/i }
|
40
46
|
end
|
41
47
|
end
|
42
48
|
end
|