acfs 1.7.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 -116
- data/README.md +19 -24
- data/acfs.gemspec +7 -10
- data/lib/acfs/collections/paginatable.rb +11 -11
- data/lib/acfs/configuration.rb +1 -1
- data/lib/acfs/errors.rb +6 -6
- data/lib/acfs/global.rb +2 -2
- data/lib/acfs/location.rb +1 -1
- data/lib/acfs/resource/attributes/uuid.rb +1 -1
- data/lib/acfs/resource/attributes.rb +1 -1
- data/lib/acfs/resource/dirty.rb +1 -1
- data/lib/acfs/resource/operational.rb +4 -4
- data/lib/acfs/resource/query_methods.rb +3 -3
- data/lib/acfs/response/status.rb +1 -1
- data/lib/acfs/service/middleware.rb +2 -2
- data/lib/acfs/singleton_resource.rb +2 -2
- data/lib/acfs/stub.rb +1 -1
- data/lib/acfs/version.rb +2 -2
- data/lib/acfs/yard.rb +1 -0
- data/spec/acfs/adapter/typhoeus_spec.rb +3 -3
- data/spec/acfs/configuration_spec.rb +1 -1
- data/spec/acfs/global_spec.rb +5 -5
- data/spec/acfs/location_spec.rb +1 -1
- data/spec/acfs/middleware/json_spec.rb +1 -1
- data/spec/acfs/middleware/message_pack_spec.rb +1 -1
- data/spec/acfs/operation_spec.rb +1 -1
- data/spec/acfs/resource/attributes/boolean_spec.rb +31 -31
- data/spec/acfs/resource/attributes/date_time_spec.rb +9 -9
- data/spec/acfs/resource/attributes/dict_spec.rb +10 -10
- data/spec/acfs/resource/attributes/float_spec.rb +11 -11
- data/spec/acfs/resource/attributes/integer_spec.rb +6 -6
- data/spec/acfs/resource/attributes/list_spec.rb +1 -1
- data/spec/acfs/resource/attributes/uuid_spec.rb +8 -8
- data/spec/acfs/resource/attributes_spec.rb +8 -8
- data/spec/acfs/resource/dirty_spec.rb +1 -1
- data/spec/acfs/resource/persistence_spec.rb +7 -7
- data/spec/acfs/resource/query_methods_spec.rb +1 -1
- data/spec/acfs/runner_spec.rb +12 -12
- data/spec/acfs/stub_spec.rb +13 -18
- data/spec/acfs_spec.rb +4 -4
- data/spec/spec_helper.rb +9 -5
- data/spec/support/hash.rb +1 -1
- 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 +204 -67
@@ -0,0 +1,25 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
=====================
|
3
|
+
|
4
|
+
* Copyright © 2012 David Chelimsky, Myron Marston
|
5
|
+
* Copyright © 2006 David Chelimsky, The RSpec Development Team
|
6
|
+
* Copyright © 2005 Steven Baker
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
9
|
+
a copy of this software and associated documentation files (the
|
10
|
+
"Software"), to deal in the Software without restriction, including
|
11
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
12
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
13
|
+
permit persons to whom the Software is furnished to do so, subject to
|
14
|
+
the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be
|
17
|
+
included in all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
20
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
21
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
22
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
23
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
25
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,326 @@
|
|
1
|
+
# RSpec Expectations [![Build Status](https://github.com/rspec/rspec-expectations/workflows/RSpec%20CI/badge.svg)](https://github.com/rspec/rspec-expectations/actions) [![Code Climate](https://codeclimate.com/github/rspec/rspec-expectations.svg)](https://codeclimate.com/github/rspec/rspec-expectations)
|
2
|
+
|
3
|
+
RSpec::Expectations lets you express expected outcomes on an object in an
|
4
|
+
example.
|
5
|
+
|
6
|
+
```ruby
|
7
|
+
expect(account.balance).to eq(Money.new(37.42, :USD))
|
8
|
+
```
|
9
|
+
|
10
|
+
## Install
|
11
|
+
|
12
|
+
If you want to use rspec-expectations with rspec, just install the rspec gem
|
13
|
+
and RubyGems will also install rspec-expectations for you (along with
|
14
|
+
rspec-core and rspec-mocks):
|
15
|
+
|
16
|
+
```shell
|
17
|
+
gem install rspec
|
18
|
+
```
|
19
|
+
|
20
|
+
Want to run against the `main` branch? You'll need to include the dependent
|
21
|
+
RSpec repos as well. Add the following to your `Gemfile`:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
%w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib|
|
25
|
+
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => 'main'
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
If you want to use rspec-expectations with another tool, like Test::Unit,
|
30
|
+
Minitest, or Cucumber, you can install it directly:
|
31
|
+
|
32
|
+
```shell
|
33
|
+
gem install rspec-expectations
|
34
|
+
```
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
Once you've set up the environment, you'll need to cd into the working
|
39
|
+
directory of whichever repo you want to work in. From there you can run the
|
40
|
+
specs and cucumber features, and make patches.
|
41
|
+
|
42
|
+
NOTE: You do not need to use rspec-dev to work on a specific RSpec repo. You
|
43
|
+
can treat each RSpec repo as an independent project.
|
44
|
+
|
45
|
+
- [Build details](BUILD_DETAIL.md)
|
46
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
47
|
+
- [Detailed contributing guide](CONTRIBUTING.md)
|
48
|
+
- [Development setup guide](DEVELOPMENT.md)
|
49
|
+
|
50
|
+
## Basic usage
|
51
|
+
|
52
|
+
Here's an example using rspec-core:
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
RSpec.describe Order do
|
56
|
+
it "sums the prices of the items in its line items" do
|
57
|
+
order = Order.new
|
58
|
+
order.add_entry(LineItem.new(:item => Item.new(
|
59
|
+
:price => Money.new(1.11, :USD)
|
60
|
+
)))
|
61
|
+
order.add_entry(LineItem.new(:item => Item.new(
|
62
|
+
:price => Money.new(2.22, :USD),
|
63
|
+
:quantity => 2
|
64
|
+
)))
|
65
|
+
expect(order.total).to eq(Money.new(5.55, :USD))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
The `describe` and `it` methods come from rspec-core. The `Order`, `LineItem`, `Item` and `Money` classes would be from _your_ code. The last line of the example
|
71
|
+
expresses an expected outcome. If `order.total == Money.new(5.55, :USD)`, then
|
72
|
+
the example passes. If not, it fails with a message like:
|
73
|
+
|
74
|
+
```
|
75
|
+
expected: #<Money @value=5.55 @currency=:USD>
|
76
|
+
got: #<Money @value=1.11 @currency=:USD>
|
77
|
+
```
|
78
|
+
|
79
|
+
## Built-in matchers
|
80
|
+
|
81
|
+
### Equivalence
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
expect(actual).to eq(expected) # passes if actual == expected
|
85
|
+
expect(actual).to eql(expected) # passes if actual.eql?(expected)
|
86
|
+
expect(actual).not_to eql(not_expected) # passes if not(actual.eql?(expected))
|
87
|
+
```
|
88
|
+
|
89
|
+
Note: The new `expect` syntax no longer supports the `==` matcher.
|
90
|
+
|
91
|
+
### Identity
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
expect(actual).to be(expected) # passes if actual.equal?(expected)
|
95
|
+
expect(actual).to equal(expected) # passes if actual.equal?(expected)
|
96
|
+
```
|
97
|
+
|
98
|
+
### Comparisons
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
expect(actual).to be > expected
|
102
|
+
expect(actual).to be >= expected
|
103
|
+
expect(actual).to be <= expected
|
104
|
+
expect(actual).to be < expected
|
105
|
+
expect(actual).to be_within(delta).of(expected)
|
106
|
+
```
|
107
|
+
|
108
|
+
### Regular expressions
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
expect(actual).to match(/expression/)
|
112
|
+
```
|
113
|
+
|
114
|
+
Note: The new `expect` syntax no longer supports the `=~` matcher.
|
115
|
+
|
116
|
+
### Types/classes
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
expect(actual).to be_an_instance_of(expected) # passes if actual.class == expected
|
120
|
+
expect(actual).to be_a(expected) # passes if actual.kind_of?(expected)
|
121
|
+
expect(actual).to be_an(expected) # an alias for be_a
|
122
|
+
expect(actual).to be_a_kind_of(expected) # another alias
|
123
|
+
```
|
124
|
+
|
125
|
+
### Truthiness
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
expect(actual).to be_truthy # passes if actual is truthy (not nil or false)
|
129
|
+
expect(actual).to be true # passes if actual == true
|
130
|
+
expect(actual).to be_falsy # passes if actual is falsy (nil or false)
|
131
|
+
expect(actual).to be false # passes if actual == false
|
132
|
+
expect(actual).to be_nil # passes if actual is nil
|
133
|
+
expect(actual).to_not be_nil # passes if actual is not nil
|
134
|
+
```
|
135
|
+
|
136
|
+
### Expecting errors
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
expect { ... }.to raise_error
|
140
|
+
expect { ... }.to raise_error(ErrorClass)
|
141
|
+
expect { ... }.to raise_error("message")
|
142
|
+
expect { ... }.to raise_error(ErrorClass, "message")
|
143
|
+
```
|
144
|
+
|
145
|
+
### Expecting throws
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
expect { ... }.to throw_symbol
|
149
|
+
expect { ... }.to throw_symbol(:symbol)
|
150
|
+
expect { ... }.to throw_symbol(:symbol, 'value')
|
151
|
+
```
|
152
|
+
|
153
|
+
### Yielding
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
expect { |b| 5.tap(&b) }.to yield_control # passes regardless of yielded args
|
157
|
+
|
158
|
+
expect { |b| yield_if_true(true, &b) }.to yield_with_no_args # passes only if no args are yielded
|
159
|
+
|
160
|
+
expect { |b| 5.tap(&b) }.to yield_with_args(5)
|
161
|
+
expect { |b| 5.tap(&b) }.to yield_with_args(Integer)
|
162
|
+
expect { |b| "a string".tap(&b) }.to yield_with_args(/str/)
|
163
|
+
|
164
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3)
|
165
|
+
expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2])
|
166
|
+
```
|
167
|
+
|
168
|
+
### Predicate matchers
|
169
|
+
|
170
|
+
```ruby
|
171
|
+
expect(actual).to be_xxx # passes if actual.xxx?
|
172
|
+
expect(actual).to have_xxx(:arg) # passes if actual.has_xxx?(:arg)
|
173
|
+
```
|
174
|
+
|
175
|
+
### Ranges (Ruby >= 1.9 only)
|
176
|
+
|
177
|
+
```ruby
|
178
|
+
expect(1..10).to cover(3)
|
179
|
+
```
|
180
|
+
|
181
|
+
### Collection membership
|
182
|
+
|
183
|
+
```ruby
|
184
|
+
# exact order, entire collection
|
185
|
+
expect(actual).to eq(expected)
|
186
|
+
|
187
|
+
# exact order, partial collection (based on an exact position)
|
188
|
+
expect(actual).to start_with(expected)
|
189
|
+
expect(actual).to end_with(expected)
|
190
|
+
|
191
|
+
# any order, entire collection
|
192
|
+
expect(actual).to match_array(expected)
|
193
|
+
|
194
|
+
# You can also express this by passing the expected elements
|
195
|
+
# as individual arguments
|
196
|
+
expect(actual).to contain_exactly(expected_element1, expected_element2)
|
197
|
+
|
198
|
+
# any order, partial collection
|
199
|
+
expect(actual).to include(expected)
|
200
|
+
```
|
201
|
+
|
202
|
+
#### Examples
|
203
|
+
|
204
|
+
```ruby
|
205
|
+
expect([1, 2, 3]).to eq([1, 2, 3]) # Order dependent equality check
|
206
|
+
expect([1, 2, 3]).to include(1) # Exact ordering, partial collection matches
|
207
|
+
expect([1, 2, 3]).to include(2, 3) #
|
208
|
+
expect([1, 2, 3]).to start_with(1) # As above, but from the start of the collection
|
209
|
+
expect([1, 2, 3]).to start_with(1, 2) #
|
210
|
+
expect([1, 2, 3]).to end_with(3) # As above but from the end of the collection
|
211
|
+
expect([1, 2, 3]).to end_with(2, 3) #
|
212
|
+
expect({:a => 'b'}).to include(:a => 'b') # Matching within hashes
|
213
|
+
expect("this string").to include("is str") # Matching within strings
|
214
|
+
expect("this string").to start_with("this") #
|
215
|
+
expect("this string").to end_with("ring") #
|
216
|
+
expect([1, 2, 3]).to contain_exactly(2, 3, 1) # Order independent matches
|
217
|
+
expect([1, 2, 3]).to match_array([3, 2, 1]) #
|
218
|
+
|
219
|
+
# Order dependent compound matchers
|
220
|
+
expect(
|
221
|
+
[{:a => 'hash'},{:a => 'another'}]
|
222
|
+
).to match([a_hash_including(:a => 'hash'), a_hash_including(:a => 'another')])
|
223
|
+
```
|
224
|
+
|
225
|
+
## `should` syntax
|
226
|
+
|
227
|
+
In addition to the `expect` syntax, rspec-expectations continues to support the
|
228
|
+
`should` syntax:
|
229
|
+
|
230
|
+
```ruby
|
231
|
+
actual.should eq expected
|
232
|
+
actual.should be > 3
|
233
|
+
[1, 2, 3].should_not include 4
|
234
|
+
```
|
235
|
+
|
236
|
+
See [detailed information on the `should` syntax and its usage.](https://github.com/rspec/rspec-expectations/blob/main/Should.md)
|
237
|
+
|
238
|
+
## Compound Matcher Expressions
|
239
|
+
|
240
|
+
You can also create compound matcher expressions using `and` or `or`:
|
241
|
+
|
242
|
+
``` ruby
|
243
|
+
expect(alphabet).to start_with("a").and end_with("z")
|
244
|
+
expect(stoplight.color).to eq("red").or eq("green").or eq("yellow")
|
245
|
+
```
|
246
|
+
|
247
|
+
## Composing Matchers
|
248
|
+
|
249
|
+
Many of the built-in matchers are designed to take matchers as
|
250
|
+
arguments, to allow you to flexibly specify only the essential
|
251
|
+
aspects of an object or data structure. In addition, all of the
|
252
|
+
built-in matchers have one or more aliases that provide better
|
253
|
+
phrasing for when they are used as arguments to another matcher.
|
254
|
+
|
255
|
+
### Examples
|
256
|
+
|
257
|
+
```ruby
|
258
|
+
expect { k += 1.05 }.to change { k }.by( a_value_within(0.1).of(1.0) )
|
259
|
+
|
260
|
+
expect { s = "barn" }.to change { s }
|
261
|
+
.from( a_string_matching(/foo/) )
|
262
|
+
.to( a_string_matching(/bar/) )
|
263
|
+
|
264
|
+
expect(["barn", 2.45]).to contain_exactly(
|
265
|
+
a_value_within(0.1).of(2.5),
|
266
|
+
a_string_starting_with("bar")
|
267
|
+
)
|
268
|
+
|
269
|
+
expect(["barn", "food", 2.45]).to end_with(
|
270
|
+
a_string_matching("foo"),
|
271
|
+
a_value > 2
|
272
|
+
)
|
273
|
+
|
274
|
+
expect(["barn", 2.45]).to include( a_string_starting_with("bar") )
|
275
|
+
|
276
|
+
expect(:a => "food", :b => "good").to include(:a => a_string_matching(/foo/))
|
277
|
+
|
278
|
+
hash = {
|
279
|
+
:a => {
|
280
|
+
:b => ["foo", 5],
|
281
|
+
:c => { :d => 2.05 }
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
expect(hash).to match(
|
286
|
+
:a => {
|
287
|
+
:b => a_collection_containing_exactly(
|
288
|
+
a_string_starting_with("f"),
|
289
|
+
an_instance_of(Integer)
|
290
|
+
),
|
291
|
+
:c => { :d => (a_value < 3) }
|
292
|
+
}
|
293
|
+
)
|
294
|
+
|
295
|
+
expect { |probe|
|
296
|
+
[1, 2, 3].each(&probe)
|
297
|
+
}.to yield_successive_args( a_value < 2, 2, a_value > 2 )
|
298
|
+
```
|
299
|
+
|
300
|
+
## Usage outside rspec-core
|
301
|
+
|
302
|
+
You always need to load `rspec/expectations` even if you only want to use one part of the library:
|
303
|
+
|
304
|
+
```ruby
|
305
|
+
require 'rspec/expectations'
|
306
|
+
```
|
307
|
+
|
308
|
+
Then simply include `RSpec::Matchers` in any class:
|
309
|
+
|
310
|
+
```ruby
|
311
|
+
class MyClass
|
312
|
+
include RSpec::Matchers
|
313
|
+
|
314
|
+
def do_something(arg)
|
315
|
+
expect(arg).to be > 0
|
316
|
+
# do other stuff
|
317
|
+
end
|
318
|
+
end
|
319
|
+
```
|
320
|
+
|
321
|
+
## Also see
|
322
|
+
|
323
|
+
* [https://github.com/rspec/rspec](https://github.com/rspec/rspec)
|
324
|
+
* [https://github.com/rspec/rspec-core](https://github.com/rspec/rspec-core)
|
325
|
+
* [https://github.com/rspec/rspec-mocks](https://github.com/rspec/rspec-mocks)
|
326
|
+
* [https://github.com/rspec/rspec-rails](https://github.com/rspec/rspec-rails)
|
@@ -0,0 +1,73 @@
|
|
1
|
+
### 2.0.0 / 2024-11-04
|
2
|
+
|
3
|
+
Version 2.0.0 drops support for Ruby below 3, and changes the supported RSpec version to "main" and current release series.
|
4
|
+
(At the time of writing this is 3.13.x, but it means the current supported release only).
|
5
|
+
|
6
|
+
Breaking changes:
|
7
|
+
|
8
|
+
* Now uses `public_send` so that private methods will not be accidentally reachable. (James Ottaway #33, #101)
|
9
|
+
|
10
|
+
### 1.3.1 / 2024-10-23
|
11
|
+
[full changelog](http://github.com/rspec/rspec-its/compare/v1.3.0...v1.3.1)
|
12
|
+
|
13
|
+
Bug fixes:
|
14
|
+
|
15
|
+
* Prevent overridden `example` methods causing issues by creating our own
|
16
|
+
Example Group creation alias `__its_example`. (Jon Rowe, #95)
|
17
|
+
|
18
|
+
### 1.3.0 / 2019-04-09
|
19
|
+
[full changelog](http://github.com/rspec/rspec-its/compare/v1.2.0...v1.3.0)
|
20
|
+
|
21
|
+
Enhancements:
|
22
|
+
* Introduced `will` and `will_not` as to allow one line block expectations.
|
23
|
+
(Russ Buchanan, #67)
|
24
|
+
|
25
|
+
### 1.2.0 / 2015-02-06
|
26
|
+
[full changelog](http://github.com/rspec/rspec-its/compare/v1.1.0...v1.2.0)
|
27
|
+
|
28
|
+
Breaking Changes:
|
29
|
+
|
30
|
+
Enhancements:
|
31
|
+
* Introduced `are_expected` as alias for `is_expected`
|
32
|
+
|
33
|
+
Bug fixes:
|
34
|
+
* Restored ability to pass key/value metadata parameters, broken by https://github.com/rspec/rspec-its/commit/71307bc7051f482bfc2798daa390bee9142b0d5a
|
35
|
+
|
36
|
+
### 1.1.0 / 2014-04-13
|
37
|
+
[full changelog](http://github.com/rspec/rspec-its/compare/v1.0.1...v1.1.0)
|
38
|
+
|
39
|
+
Breaking Changes:
|
40
|
+
|
41
|
+
Enhancements:
|
42
|
+
* For hashes, multiple array elements are treated as successive access keys
|
43
|
+
* Metadata arguments are now supported
|
44
|
+
|
45
|
+
Bug fixes:
|
46
|
+
* Enable `its` example selection by line number in command line
|
47
|
+
|
48
|
+
|
49
|
+
### 1.0.1 / 2014-04-13
|
50
|
+
[full changelog](http://github.com/rspec/rspec-its/compare/v1.0.0...v1.0.1)
|
51
|
+
|
52
|
+
Bug fixes:
|
53
|
+
* Maintain implicit subject in all cases (addresses problem with latest RSpec 3 version)
|
54
|
+
|
55
|
+
### 1.0.0 / 2014-02-07
|
56
|
+
[full changelog](http://github.com/rspec/rspec-its/compare/v1.0.0.pre...v1.0.0)
|
57
|
+
|
58
|
+
Breaking Changes:
|
59
|
+
|
60
|
+
Enhancements:
|
61
|
+
* Add `is_expected` support to match RSpec 3.0
|
62
|
+
|
63
|
+
Deprecations:
|
64
|
+
|
65
|
+
Bug Fixes:
|
66
|
+
* Report failures and backtrace from client perspective
|
67
|
+
|
68
|
+
### 1.0.0.pre / 2013-10-11
|
69
|
+
|
70
|
+
Features
|
71
|
+
|
72
|
+
* Initial extraction of `its()` functionality to separate gem
|
73
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2024 The RSpec Development Team
|
4
|
+
Copyright (c) 2013 Peter Alfvin
|
5
|
+
Copyright (c) 2012 David Chelimsky, Myron Marston
|
6
|
+
Copyright (c) 2006 David Chelimsky, The RSpec Development Team
|
7
|
+
|
8
|
+
MIT License
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
11
|
+
a copy of this software and associated documentation files (the
|
12
|
+
"Software"), to deal in the Software without restriction, including
|
13
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
14
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
15
|
+
permit persons to whom the Software is furnished to do so, subject to
|
16
|
+
the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be
|
19
|
+
included in all copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
22
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
23
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
24
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
25
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
26
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
27
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# RSpec::Its [![Build Status](https://github.com/rspec/rspec-its/actions/workflows/ci.yml/badge.svg)](https://github.com/rspec/rspec-its/actions/workflows/ci.yml/badge.svg)
|
2
|
+
|
3
|
+
RSpec::Its provides the `its` method as a short-hand to specify the expected value of an attribute.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rspec-its'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install rspec-its
|
20
|
+
|
21
|
+
And require it as:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'rspec/its'
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Use the `its` method to generate a nested example group with a single example that specifies the expected value
|
30
|
+
of an attribute of the subject using `is_expected`. The `its` method can also specify the block expectations of
|
31
|
+
an attribute of the subject using `will` or `will_not`.
|
32
|
+
|
33
|
+
`its` accepts a symbol or a string, and a block representing the example.
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
its(:size) { is_expected.to eq(1) }
|
37
|
+
its("length") { is_expected.to eq(1) }
|
38
|
+
```
|
39
|
+
|
40
|
+
You can use a string with dots to specify a nested attribute (i.e. an
|
41
|
+
attribute of the attribute of the subject).
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
its("phone_numbers.size") { is_expected.to_not eq(0) }
|
45
|
+
```
|
46
|
+
|
47
|
+
The following should-style method is also available:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
its(:size) { should eq(1) }
|
51
|
+
```
|
52
|
+
|
53
|
+
as is an alias of `is_expected` for pluralized use:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
its(:keys) { are_expected.to eq([:key1, :key2]) }
|
57
|
+
```
|
58
|
+
|
59
|
+
The following block expect-style method is also available:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
its(:size) { will_not raise_error }
|
63
|
+
```
|
64
|
+
|
65
|
+
as is this alias for pluralized use:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
its(:keys) { will raise_error(NoMethodError) }
|
69
|
+
```
|
70
|
+
|
71
|
+
When the subject implements the `[]` operator, you can pass in an array with a single key to
|
72
|
+
refer to the value returned by that operator when passed that key as an argument.
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
its([:key]) { is_expected.to eq(value) }
|
76
|
+
```
|
77
|
+
|
78
|
+
For hashes, multiple keys within the array will result in successive accesses into the hash. For example:
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
subject { {key1: {key2: 3} } }
|
82
|
+
its([:key1, :key2]) { is_expected.to eq(3) }
|
83
|
+
```
|
84
|
+
|
85
|
+
For other objects, multiple keys within the array will be passed as separate arguments in a single method call to [], as in:
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
subject { Matrix[ [:a, :b], [:c, :d] ] }
|
89
|
+
its([1,1]) { is_expected.to eq(:d) }
|
90
|
+
```
|
91
|
+
|
92
|
+
Metadata arguments are supported.
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
its(:size, focus: true) { is_expected.to eq(1) }
|
96
|
+
```
|
97
|
+
|
98
|
+
## Contributing
|
99
|
+
|
100
|
+
1. Fork it
|
101
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
102
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
103
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
104
|
+
5. Create new Pull Request
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'rspec/its/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "rspec-its"
|
9
|
+
spec.version = RSpec::Its::VERSION
|
10
|
+
spec.authors = ["The RSpec Development Team"]
|
11
|
+
spec.email = ["maintainers@rspec.info"]
|
12
|
+
spec.description = 'RSpec extension gem for attribute matching'
|
13
|
+
spec.summary = 'Provides "its" method formerly part of rspec-core'
|
14
|
+
spec.homepage = "https://github.com/rspec/rspec-its"
|
15
|
+
spec.license = "MIT"
|
16
|
+
spec.required_ruby_version = '> 3.0.0'
|
17
|
+
|
18
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/rspec/rspec-its/issues'
|
19
|
+
spec.metadata['changelog_uri'] = "https://github.com/rspec/rspec-its/blob/v#{spec.version}/Changelog.md"
|
20
|
+
spec.metadata['documentation_uri'] = "https://www.rubydoc.info/gems/rspec-its/#{spec.version}"
|
21
|
+
spec.metadata['mailing_list_uri'] = 'https://groups.google.com/forum/#!forum/rspec'
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
|
+
spec.metadata['source_code_uri'] = 'https://github.com/rspec/rspec-its'
|
24
|
+
|
25
|
+
spec.files = `git ls-files`.split($/) - %w[cucumber.yml]
|
26
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_dependency 'rspec-core', '>= 3.13.0'
|
30
|
+
spec.add_dependency 'rspec-expectations', '>= 3.13.0'
|
31
|
+
end
|