mercadopago-custom-checkout 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.gs/bin/rake +23 -0
- data/.gs/cache/faraday-0.9.2.gem +0 -0
- data/.gs/cache/minitest-5.9.0.gem +0 -0
- data/.gs/cache/multi_json-1.12.1.gem +0 -0
- data/.gs/cache/multipart-post-2.0.0.gem +0 -0
- data/.gs/cache/rake-10.5.0.gem +0 -0
- data/.gs/gems/faraday-0.9.2/LICENSE.md +20 -0
- data/.gs/gems/faraday-0.9.2/README.md +245 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday.rb +268 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter.rb +46 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http.rb +237 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http_ssl_patch.rb +56 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony.rb +100 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony/parallel_manager.rb +66 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/excon.rb +81 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/httpclient.rb +117 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb +130 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http_persistent.rb +49 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/patron.rb +78 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/rack.rb +58 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/test.rb +162 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/typhoeus.rb +123 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/autoload.rb +84 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/connection.rb +437 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/error.rb +53 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/middleware.rb +37 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/options.rb +359 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/parameters.rb +197 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/rack_builder.rb +213 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request.rb +92 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/authorization.rb +42 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/basic_authentication.rb +13 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/instrumentation.rb +36 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/multipart.rb +63 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/retry.rb +154 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/token_authentication.rb +15 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb +36 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/response.rb +93 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/response/logger.rb +59 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/response/raise_error.rb +21 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/upload_io.rb +67 -0
- data/.gs/gems/faraday-0.9.2/lib/faraday/utils.rb +309 -0
- data/.gs/gems/minitest-5.9.0/.autotest +34 -0
- data/.gs/gems/minitest-5.9.0/History.rdoc +1176 -0
- data/.gs/gems/minitest-5.9.0/Manifest.txt +26 -0
- data/.gs/gems/minitest-5.9.0/README.rdoc +656 -0
- data/.gs/gems/minitest-5.9.0/Rakefile +72 -0
- data/.gs/gems/minitest-5.9.0/design_rationale.rb +52 -0
- data/.gs/gems/minitest-5.9.0/lib/hoe/minitest.rb +26 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest.rb +815 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/assertions.rb +674 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/autorun.rb +13 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/benchmark.rb +424 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/expectations.rb +284 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/hell.rb +17 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/mock.rb +232 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/parallel.rb +69 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/pride.rb +4 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/pride_plugin.rb +142 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/spec.rb +331 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/test.rb +284 -0
- data/.gs/gems/minitest-5.9.0/lib/minitest/unit.rb +45 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/metametameta.rb +90 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_benchmark.rb +137 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_mock.rb +512 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_reporter.rb +281 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_spec.rb +967 -0
- data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_test.rb +1983 -0
- data/.gs/gems/multi_json-1.12.1/CHANGELOG.md +245 -0
- data/.gs/gems/multi_json-1.12.1/CONTRIBUTING.md +46 -0
- data/.gs/gems/multi_json-1.12.1/LICENSE.md +20 -0
- data/.gs/gems/multi_json-1.12.1/README.md +121 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json.rb +161 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter.rb +49 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter_error.rb +15 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/gson.rb +20 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/jr_jackson.rb +25 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_common.rb +23 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_gem.rb +11 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_pure.rb +11 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/nsjsonserialization.rb +32 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/oj.rb +25 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/ok_json.rb +23 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/yajl.rb +19 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/convertible_hash_keys.rb +43 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/options.rb +39 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/options_cache.rb +29 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/parse_error.rb +17 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/vendor/okjson.rb +606 -0
- data/.gs/gems/multi_json-1.12.1/lib/multi_json/version.rb +17 -0
- data/.gs/gems/multi_json-1.12.1/multi_json.gemspec +20 -0
- data/.gs/gems/multipart-post-2.0.0/.gitignore +6 -0
- data/.gs/gems/multipart-post-2.0.0/.travis.yml +7 -0
- data/.gs/gems/multipart-post-2.0.0/Gemfile +14 -0
- data/.gs/gems/multipart-post-2.0.0/History.txt +60 -0
- data/.gs/gems/multipart-post-2.0.0/Manifest.txt +9 -0
- data/.gs/gems/multipart-post-2.0.0/README.md +77 -0
- data/.gs/gems/multipart-post-2.0.0/Rakefile +9 -0
- data/.gs/gems/multipart-post-2.0.0/lib/composite_io.rb +108 -0
- data/.gs/gems/multipart-post-2.0.0/lib/multipart_post.rb +9 -0
- data/.gs/gems/multipart-post-2.0.0/lib/multipartable.rb +29 -0
- data/.gs/gems/multipart-post-2.0.0/lib/net/http/post/multipart.rb +27 -0
- data/.gs/gems/multipart-post-2.0.0/lib/parts.rb +96 -0
- data/.gs/gems/multipart-post-2.0.0/multipart-post.gemspec +22 -0
- data/.gs/gems/multipart-post-2.0.0/test/multibyte.txt +1 -0
- data/.gs/gems/multipart-post-2.0.0/test/net/http/post/test_multipart.rb +110 -0
- data/.gs/gems/multipart-post-2.0.0/test/test_composite_io.rb +115 -0
- data/.gs/gems/multipart-post-2.0.0/test/test_parts.rb +86 -0
- data/.gs/gems/rake-10.5.0/.autotest +7 -0
- data/.gs/gems/rake-10.5.0/.rubocop.yml +27 -0
- data/.gs/gems/rake-10.5.0/.togglerc +7 -0
- data/.gs/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
- data/.gs/gems/rake-10.5.0/History.rdoc +659 -0
- data/.gs/gems/rake-10.5.0/MIT-LICENSE +21 -0
- data/.gs/gems/rake-10.5.0/Manifest.txt +166 -0
- data/.gs/gems/rake-10.5.0/README.rdoc +139 -0
- data/.gs/gems/rake-10.5.0/Rakefile +81 -0
- data/.gs/gems/rake-10.5.0/bin/rake +33 -0
- data/.gs/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
- data/.gs/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
- data/.gs/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
- data/.gs/gems/rake-10.5.0/doc/example/a.c +6 -0
- data/.gs/gems/rake-10.5.0/doc/example/b.c +6 -0
- data/.gs/gems/rake-10.5.0/doc/example/main.c +11 -0
- data/.gs/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
- data/.gs/gems/rake-10.5.0/doc/jamis.rb +591 -0
- data/.gs/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
- data/.gs/gems/rake-10.5.0/doc/rake.1 +141 -0
- data/.gs/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
- data/.gs/gems/rake-10.5.0/doc/rational.rdoc +151 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/.gs/gems/rake-10.5.0/lib/rake.rb +79 -0
- data/.gs/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
- data/.gs/gems/rake-10.5.0/lib/rake/application.rb +790 -0
- data/.gs/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
- data/.gs/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
- data/.gs/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
- data/.gs/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
- data/.gs/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
- data/.gs/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
- data/.gs/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
- data/.gs/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
- data/.gs/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
- data/.gs/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
- data/.gs/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
- data/.gs/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/.gs/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
- data/.gs/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
- data/.gs/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
- data/.gs/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
- data/.gs/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
- data/.gs/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
- data/.gs/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
- data/.gs/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
- data/.gs/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
- data/.gs/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
- data/.gs/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
- data/.gs/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
- data/.gs/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/.gs/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
- data/.gs/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task.rb +383 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
- data/.gs/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
- data/.gs/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
- data/.gs/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
- data/.gs/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
- data/.gs/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
- data/.gs/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
- data/.gs/gems/rake-10.5.0/lib/rake/version.rb +7 -0
- data/.gs/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
- data/.gs/gems/rake-10.5.0/rakelib/publish.rake +20 -0
- data/.gs/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
- data/.gs/gems/rake-10.5.0/test/file_creation.rb +34 -0
- data/.gs/gems/rake-10.5.0/test/helper.rb +129 -0
- data/.gs/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
- data/.gs/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
- data/.gs/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
- data/.gs/gems/rake-10.5.0/test/test_rake.rb +40 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
- data/.gs/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
- data/.gs/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
- data/.gs/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
- data/.gs/specifications/faraday-0.9.2.gemspec +31 -0
- data/.gs/specifications/minitest-5.9.0.gemspec +39 -0
- data/.gs/specifications/multi_json-1.12.1.gemspec +33 -0
- data/.gs/specifications/multipart-post-2.0.0.gemspec +22 -0
- data/.gs/specifications/rake-10.5.0.gemspec +43 -0
- data/.rubocop.yml +36 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +38 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/mercadopago/core/client.rb +70 -0
- data/lib/mercadopago/core/endpoints.rb +134 -0
- data/lib/mercadopago/core/errors.rb +6 -0
- data/lib/mercadopago/core/gateway.rb +84 -0
- data/lib/mercadopago/custom_checkout.rb +29 -0
- data/lib/mercadopago/custom_checkout/account.rb +162 -0
- data/lib/mercadopago/custom_checkout/card_issuer.rb +20 -0
- data/lib/mercadopago/custom_checkout/card_token.rb +57 -0
- data/lib/mercadopago/custom_checkout/customer.rb +84 -0
- data/lib/mercadopago/custom_checkout/errors.rb +6 -0
- data/lib/mercadopago/custom_checkout/identification_type.rb +19 -0
- data/lib/mercadopago/custom_checkout/payment_method.rb +42 -0
- data/lib/mercadopago/custom_checkout/payments.rb +24 -0
- data/lib/mercadopago/custom_checkout/resource.rb +14 -0
- data/lib/mercadopago/custom_checkout/version.rb +5 -0
- data/mercadopago-custom-checkout.gemspec +30 -0
- metadata +455 -0
@@ -0,0 +1,674 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require "rbconfig"
|
4
|
+
require "tempfile"
|
5
|
+
require "stringio"
|
6
|
+
|
7
|
+
module Minitest
|
8
|
+
##
|
9
|
+
# Minitest Assertions. All assertion methods accept a +msg+ which is
|
10
|
+
# printed if the assertion fails.
|
11
|
+
#
|
12
|
+
# Protocol: Nearly everything here boils up to +assert+, which
|
13
|
+
# expects to be able to increment an instance accessor named
|
14
|
+
# +assertions+. This is not provided by Assertions and must be
|
15
|
+
# provided by the thing including Assertions. See Minitest::Runnable
|
16
|
+
# for an example.
|
17
|
+
|
18
|
+
module Assertions
|
19
|
+
UNDEFINED = Object.new # :nodoc:
|
20
|
+
|
21
|
+
def UNDEFINED.inspect # :nodoc:
|
22
|
+
"UNDEFINED" # again with the rdoc bugs... :(
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Returns the diff command to use in #diff. Tries to intelligently
|
27
|
+
# figure out what diff to use.
|
28
|
+
|
29
|
+
def self.diff
|
30
|
+
@diff = if (RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ &&
|
31
|
+
system("diff.exe", __FILE__, __FILE__)) then
|
32
|
+
"diff.exe -u"
|
33
|
+
elsif Minitest::Test.maglev? then
|
34
|
+
"diff -u"
|
35
|
+
elsif system("gdiff", __FILE__, __FILE__)
|
36
|
+
"gdiff -u" # solaris and kin suck
|
37
|
+
elsif system("diff", __FILE__, __FILE__)
|
38
|
+
"diff -u"
|
39
|
+
else
|
40
|
+
nil
|
41
|
+
end unless defined? @diff
|
42
|
+
|
43
|
+
@diff
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Set the diff command to use in #diff.
|
48
|
+
|
49
|
+
def self.diff= o
|
50
|
+
@diff = o
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Returns a diff between +exp+ and +act+. If there is no known
|
55
|
+
# diff command or if it doesn't make sense to diff the output
|
56
|
+
# (single line, short output), then it simply returns a basic
|
57
|
+
# comparison between the two.
|
58
|
+
|
59
|
+
def diff exp, act
|
60
|
+
expect = mu_pp_for_diff exp
|
61
|
+
butwas = mu_pp_for_diff act
|
62
|
+
result = nil
|
63
|
+
|
64
|
+
need_to_diff =
|
65
|
+
(expect.include?("\n") ||
|
66
|
+
butwas.include?("\n") ||
|
67
|
+
expect.size > 30 ||
|
68
|
+
butwas.size > 30 ||
|
69
|
+
expect == butwas) &&
|
70
|
+
Minitest::Assertions.diff
|
71
|
+
|
72
|
+
return "Expected: #{mu_pp exp}\n Actual: #{mu_pp act}" unless
|
73
|
+
need_to_diff
|
74
|
+
|
75
|
+
Tempfile.open("expect") do |a|
|
76
|
+
a.puts expect
|
77
|
+
a.flush
|
78
|
+
|
79
|
+
Tempfile.open("butwas") do |b|
|
80
|
+
b.puts butwas
|
81
|
+
b.flush
|
82
|
+
|
83
|
+
result = `#{Minitest::Assertions.diff} #{a.path} #{b.path}`
|
84
|
+
result.sub!(/^\-\-\- .+/, "--- expected")
|
85
|
+
result.sub!(/^\+\+\+ .+/, "+++ actual")
|
86
|
+
|
87
|
+
if result.empty? then
|
88
|
+
klass = exp.class
|
89
|
+
result = [
|
90
|
+
"No visible difference in the #{klass}#inspect output.\n",
|
91
|
+
"You should look at the implementation of #== on ",
|
92
|
+
"#{klass} or its members.\n",
|
93
|
+
expect,
|
94
|
+
].join
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
result
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# This returns a human-readable version of +obj+. By default
|
104
|
+
# #inspect is called. You can override this to use #pretty_print
|
105
|
+
# if you want.
|
106
|
+
|
107
|
+
def mu_pp obj
|
108
|
+
s = obj.inspect
|
109
|
+
|
110
|
+
if defined? Encoding then
|
111
|
+
s = s.encode Encoding.default_external
|
112
|
+
|
113
|
+
if String === obj && obj.encoding != Encoding.default_external then
|
114
|
+
s = "# encoding: #{obj.encoding}\n#{s}"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
s
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# This returns a diff-able human-readable version of +obj+. This
|
123
|
+
# differs from the regular mu_pp because it expands escaped
|
124
|
+
# newlines and makes hex-values generic (like object_ids). This
|
125
|
+
# uses mu_pp to do the first pass and then cleans it up.
|
126
|
+
|
127
|
+
def mu_pp_for_diff obj
|
128
|
+
mu_pp(obj).gsub(/\\n/, "\n").gsub(/:0x[a-fA-F0-9]{4,}/m, ":0xXXXXXX")
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Fails unless +test+ is truthy.
|
133
|
+
|
134
|
+
def assert test, msg = nil
|
135
|
+
self.assertions += 1
|
136
|
+
unless test then
|
137
|
+
msg ||= "Expected #{mu_pp test} to be truthy."
|
138
|
+
msg = msg.call if Proc === msg
|
139
|
+
raise Minitest::Assertion, msg
|
140
|
+
end
|
141
|
+
true
|
142
|
+
end
|
143
|
+
|
144
|
+
def _synchronize # :nodoc:
|
145
|
+
yield
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Fails unless +obj+ is empty.
|
150
|
+
|
151
|
+
def assert_empty obj, msg = nil
|
152
|
+
msg = message(msg) { "Expected #{mu_pp(obj)} to be empty" }
|
153
|
+
assert_respond_to obj, :empty?
|
154
|
+
assert obj.empty?, msg
|
155
|
+
end
|
156
|
+
|
157
|
+
E = "" # :nodoc:
|
158
|
+
|
159
|
+
##
|
160
|
+
# Fails unless <tt>exp == act</tt> printing the difference between
|
161
|
+
# the two, if possible.
|
162
|
+
#
|
163
|
+
# If there is no visible difference but the assertion fails, you
|
164
|
+
# should suspect that your #== is buggy, or your inspect output is
|
165
|
+
# missing crucial details. For nicer structural diffing, set
|
166
|
+
# Minitest::Test.make_my_diffs_pretty!
|
167
|
+
#
|
168
|
+
# For floats use assert_in_delta.
|
169
|
+
#
|
170
|
+
# See also: Minitest::Assertions.diff
|
171
|
+
|
172
|
+
def assert_equal exp, act, msg = nil
|
173
|
+
msg = message(msg, E) { diff exp, act }
|
174
|
+
assert exp == act, msg
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# For comparing Floats. Fails unless +exp+ and +act+ are within +delta+
|
179
|
+
# of each other.
|
180
|
+
#
|
181
|
+
# assert_in_delta Math::PI, (22.0 / 7.0), 0.01
|
182
|
+
|
183
|
+
def assert_in_delta exp, act, delta = 0.001, msg = nil
|
184
|
+
n = (exp - act).abs
|
185
|
+
msg = message(msg) {
|
186
|
+
"Expected |#{exp} - #{act}| (#{n}) to be <= #{delta}"
|
187
|
+
}
|
188
|
+
assert delta >= n, msg
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# For comparing Floats. Fails unless +exp+ and +act+ have a relative
|
193
|
+
# error less than +epsilon+.
|
194
|
+
|
195
|
+
def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
|
196
|
+
assert_in_delta a, b, [a.abs, b.abs].min * epsilon, msg
|
197
|
+
end
|
198
|
+
|
199
|
+
##
|
200
|
+
# Fails unless +collection+ includes +obj+.
|
201
|
+
|
202
|
+
def assert_includes collection, obj, msg = nil
|
203
|
+
msg = message(msg) {
|
204
|
+
"Expected #{mu_pp(collection)} to include #{mu_pp(obj)}"
|
205
|
+
}
|
206
|
+
assert_respond_to collection, :include?
|
207
|
+
assert collection.include?(obj), msg
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# Fails unless +obj+ is an instance of +cls+.
|
212
|
+
|
213
|
+
def assert_instance_of cls, obj, msg = nil
|
214
|
+
msg = message(msg) {
|
215
|
+
"Expected #{mu_pp(obj)} to be an instance of #{cls}, not #{obj.class}"
|
216
|
+
}
|
217
|
+
|
218
|
+
assert obj.instance_of?(cls), msg
|
219
|
+
end
|
220
|
+
|
221
|
+
##
|
222
|
+
# Fails unless +obj+ is a kind of +cls+.
|
223
|
+
|
224
|
+
def assert_kind_of cls, obj, msg = nil
|
225
|
+
msg = message(msg) {
|
226
|
+
"Expected #{mu_pp(obj)} to be a kind of #{cls}, not #{obj.class}" }
|
227
|
+
|
228
|
+
assert obj.kind_of?(cls), msg
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# Fails unless +matcher+ <tt>=~</tt> +obj+.
|
233
|
+
|
234
|
+
def assert_match matcher, obj, msg = nil
|
235
|
+
msg = message(msg) { "Expected #{mu_pp matcher} to match #{mu_pp obj}" }
|
236
|
+
assert_respond_to matcher, :"=~"
|
237
|
+
matcher = Regexp.new Regexp.escape matcher if String === matcher
|
238
|
+
assert matcher =~ obj, msg
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# Fails unless +obj+ is nil
|
243
|
+
|
244
|
+
def assert_nil obj, msg = nil
|
245
|
+
msg = message(msg) { "Expected #{mu_pp(obj)} to be nil" }
|
246
|
+
assert obj.nil?, msg
|
247
|
+
end
|
248
|
+
|
249
|
+
##
|
250
|
+
# For testing with binary operators. Eg:
|
251
|
+
#
|
252
|
+
# assert_operator 5, :<=, 4
|
253
|
+
|
254
|
+
def assert_operator o1, op, o2 = UNDEFINED, msg = nil
|
255
|
+
return assert_predicate o1, op, msg if UNDEFINED == o2
|
256
|
+
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
|
257
|
+
assert o1.__send__(op, o2), msg
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# Fails if stdout or stderr do not output the expected results.
|
262
|
+
# Pass in nil if you don't care about that streams output. Pass in
|
263
|
+
# "" if you require it to be silent. Pass in a regexp if you want
|
264
|
+
# to pattern match.
|
265
|
+
#
|
266
|
+
# assert_output(/hey/) { method_with_output }
|
267
|
+
#
|
268
|
+
# NOTE: this uses #capture_io, not #capture_subprocess_io.
|
269
|
+
#
|
270
|
+
# See also: #assert_silent
|
271
|
+
|
272
|
+
def assert_output stdout = nil, stderr = nil
|
273
|
+
out, err = capture_io do
|
274
|
+
yield
|
275
|
+
end
|
276
|
+
|
277
|
+
err_msg = Regexp === stderr ? :assert_match : :assert_equal if stderr
|
278
|
+
out_msg = Regexp === stdout ? :assert_match : :assert_equal if stdout
|
279
|
+
|
280
|
+
y = send err_msg, stderr, err, "In stderr" if err_msg
|
281
|
+
x = send out_msg, stdout, out, "In stdout" if out_msg
|
282
|
+
|
283
|
+
(!stdout || x) && (!stderr || y)
|
284
|
+
end
|
285
|
+
|
286
|
+
##
|
287
|
+
# For testing with predicates. Eg:
|
288
|
+
#
|
289
|
+
# assert_predicate str, :empty?
|
290
|
+
#
|
291
|
+
# This is really meant for specs and is front-ended by assert_operator:
|
292
|
+
#
|
293
|
+
# str.must_be :empty?
|
294
|
+
|
295
|
+
def assert_predicate o1, op, msg = nil
|
296
|
+
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op}" }
|
297
|
+
assert o1.__send__(op), msg
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# Fails unless the block raises one of +exp+. Returns the
|
302
|
+
# exception matched so you can check the message, attributes, etc.
|
303
|
+
#
|
304
|
+
# +exp+ takes an optional message on the end to help explain
|
305
|
+
# failures and defaults to StandardError if no exception class is
|
306
|
+
# passed.
|
307
|
+
|
308
|
+
def assert_raises *exp
|
309
|
+
msg = "#{exp.pop}.\n" if String === exp.last
|
310
|
+
exp << StandardError if exp.empty?
|
311
|
+
|
312
|
+
begin
|
313
|
+
yield
|
314
|
+
rescue *exp => e
|
315
|
+
pass # count assertion
|
316
|
+
return e
|
317
|
+
rescue Minitest::Skip, Minitest::Assertion
|
318
|
+
# don't count assertion
|
319
|
+
raise
|
320
|
+
rescue SignalException, SystemExit
|
321
|
+
raise
|
322
|
+
rescue Exception => e
|
323
|
+
flunk proc {
|
324
|
+
exception_details(e, "#{msg}#{mu_pp(exp)} exception expected, not")
|
325
|
+
}
|
326
|
+
end
|
327
|
+
|
328
|
+
exp = exp.first if exp.size == 1
|
329
|
+
|
330
|
+
flunk "#{msg}#{mu_pp(exp)} expected but nothing was raised."
|
331
|
+
end
|
332
|
+
|
333
|
+
##
|
334
|
+
# Fails unless +obj+ responds to +meth+.
|
335
|
+
|
336
|
+
def assert_respond_to obj, meth, msg = nil
|
337
|
+
msg = message(msg) {
|
338
|
+
"Expected #{mu_pp(obj)} (#{obj.class}) to respond to ##{meth}"
|
339
|
+
}
|
340
|
+
assert obj.respond_to?(meth), msg
|
341
|
+
end
|
342
|
+
|
343
|
+
##
|
344
|
+
# Fails unless +exp+ and +act+ are #equal?
|
345
|
+
|
346
|
+
def assert_same exp, act, msg = nil
|
347
|
+
msg = message(msg) {
|
348
|
+
data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]
|
349
|
+
"Expected %s (oid=%d) to be the same as %s (oid=%d)" % data
|
350
|
+
}
|
351
|
+
assert exp.equal?(act), msg
|
352
|
+
end
|
353
|
+
|
354
|
+
##
|
355
|
+
# +send_ary+ is a receiver, message and arguments.
|
356
|
+
#
|
357
|
+
# Fails unless the call returns a true value
|
358
|
+
|
359
|
+
def assert_send send_ary, m = nil
|
360
|
+
recv, msg, *args = send_ary
|
361
|
+
m = message(m) {
|
362
|
+
"Expected #{mu_pp(recv)}.#{msg}(*#{mu_pp(args)}) to return true" }
|
363
|
+
assert recv.__send__(msg, *args), m
|
364
|
+
end
|
365
|
+
|
366
|
+
##
|
367
|
+
# Fails if the block outputs anything to stderr or stdout.
|
368
|
+
#
|
369
|
+
# See also: #assert_output
|
370
|
+
|
371
|
+
def assert_silent
|
372
|
+
assert_output "", "" do
|
373
|
+
yield
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
##
|
378
|
+
# Fails unless the block throws +sym+
|
379
|
+
|
380
|
+
def assert_throws sym, msg = nil
|
381
|
+
default = "Expected #{mu_pp(sym)} to have been thrown"
|
382
|
+
caught = true
|
383
|
+
catch(sym) do
|
384
|
+
begin
|
385
|
+
yield
|
386
|
+
rescue ThreadError => e # wtf?!? 1.8 + threads == suck
|
387
|
+
default += ", not \:#{e.message[/uncaught throw \`(\w+?)\'/, 1]}"
|
388
|
+
rescue ArgumentError => e # 1.9 exception
|
389
|
+
default += ", not #{e.message.split(/ /).last}"
|
390
|
+
rescue NameError => e # 1.8 exception
|
391
|
+
default += ", not #{e.name.inspect}"
|
392
|
+
end
|
393
|
+
caught = false
|
394
|
+
end
|
395
|
+
|
396
|
+
assert caught, message(msg) { default }
|
397
|
+
end
|
398
|
+
|
399
|
+
##
|
400
|
+
# Captures $stdout and $stderr into strings:
|
401
|
+
#
|
402
|
+
# out, err = capture_io do
|
403
|
+
# puts "Some info"
|
404
|
+
# warn "You did a bad thing"
|
405
|
+
# end
|
406
|
+
#
|
407
|
+
# assert_match %r%info%, out
|
408
|
+
# assert_match %r%bad%, err
|
409
|
+
#
|
410
|
+
# NOTE: For efficiency, this method uses StringIO and does not
|
411
|
+
# capture IO for subprocesses. Use #capture_subprocess_io for
|
412
|
+
# that.
|
413
|
+
|
414
|
+
def capture_io
|
415
|
+
_synchronize do
|
416
|
+
begin
|
417
|
+
captured_stdout, captured_stderr = StringIO.new, StringIO.new
|
418
|
+
|
419
|
+
orig_stdout, orig_stderr = $stdout, $stderr
|
420
|
+
$stdout, $stderr = captured_stdout, captured_stderr
|
421
|
+
|
422
|
+
yield
|
423
|
+
|
424
|
+
return captured_stdout.string, captured_stderr.string
|
425
|
+
ensure
|
426
|
+
$stdout = orig_stdout
|
427
|
+
$stderr = orig_stderr
|
428
|
+
end
|
429
|
+
end
|
430
|
+
end
|
431
|
+
|
432
|
+
##
|
433
|
+
# Captures $stdout and $stderr into strings, using Tempfile to
|
434
|
+
# ensure that subprocess IO is captured as well.
|
435
|
+
#
|
436
|
+
# out, err = capture_subprocess_io do
|
437
|
+
# system "echo Some info"
|
438
|
+
# system "echo You did a bad thing 1>&2"
|
439
|
+
# end
|
440
|
+
#
|
441
|
+
# assert_match %r%info%, out
|
442
|
+
# assert_match %r%bad%, err
|
443
|
+
#
|
444
|
+
# NOTE: This method is approximately 10x slower than #capture_io so
|
445
|
+
# only use it when you need to test the output of a subprocess.
|
446
|
+
|
447
|
+
def capture_subprocess_io
|
448
|
+
_synchronize do
|
449
|
+
begin
|
450
|
+
require "tempfile"
|
451
|
+
|
452
|
+
captured_stdout, captured_stderr = Tempfile.new("out"), Tempfile.new("err")
|
453
|
+
|
454
|
+
orig_stdout, orig_stderr = $stdout.dup, $stderr.dup
|
455
|
+
$stdout.reopen captured_stdout
|
456
|
+
$stderr.reopen captured_stderr
|
457
|
+
|
458
|
+
yield
|
459
|
+
|
460
|
+
$stdout.rewind
|
461
|
+
$stderr.rewind
|
462
|
+
|
463
|
+
return captured_stdout.read, captured_stderr.read
|
464
|
+
ensure
|
465
|
+
captured_stdout.unlink
|
466
|
+
captured_stderr.unlink
|
467
|
+
$stdout.reopen orig_stdout
|
468
|
+
$stderr.reopen orig_stderr
|
469
|
+
end
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
473
|
+
##
|
474
|
+
# Returns details for exception +e+
|
475
|
+
|
476
|
+
def exception_details e, msg
|
477
|
+
[
|
478
|
+
"#{msg}",
|
479
|
+
"Class: <#{e.class}>",
|
480
|
+
"Message: <#{e.message.inspect}>",
|
481
|
+
"---Backtrace---",
|
482
|
+
"#{Minitest.filter_backtrace(e.backtrace).join("\n")}",
|
483
|
+
"---------------",
|
484
|
+
].join "\n"
|
485
|
+
end
|
486
|
+
|
487
|
+
##
|
488
|
+
# Fails with +msg+
|
489
|
+
|
490
|
+
def flunk msg = nil
|
491
|
+
msg ||= "Epic Fail!"
|
492
|
+
assert false, msg
|
493
|
+
end
|
494
|
+
|
495
|
+
##
|
496
|
+
# Returns a proc that will output +msg+ along with the default message.
|
497
|
+
|
498
|
+
def message msg = nil, ending = nil, &default
|
499
|
+
proc {
|
500
|
+
msg = msg.call.chomp(".") if Proc === msg
|
501
|
+
custom_message = "#{msg}.\n" unless msg.nil? or msg.to_s.empty?
|
502
|
+
"#{custom_message}#{default.call}#{ending || "."}"
|
503
|
+
}
|
504
|
+
end
|
505
|
+
|
506
|
+
##
|
507
|
+
# used for counting assertions
|
508
|
+
|
509
|
+
def pass _msg = nil
|
510
|
+
assert true
|
511
|
+
end
|
512
|
+
|
513
|
+
##
|
514
|
+
# Fails if +test+ is truthy.
|
515
|
+
|
516
|
+
def refute test, msg = nil
|
517
|
+
msg ||= message { "Expected #{mu_pp(test)} to not be truthy" }
|
518
|
+
not assert !test, msg
|
519
|
+
end
|
520
|
+
|
521
|
+
##
|
522
|
+
# Fails if +obj+ is empty.
|
523
|
+
|
524
|
+
def refute_empty obj, msg = nil
|
525
|
+
msg = message(msg) { "Expected #{mu_pp(obj)} to not be empty" }
|
526
|
+
assert_respond_to obj, :empty?
|
527
|
+
refute obj.empty?, msg
|
528
|
+
end
|
529
|
+
|
530
|
+
##
|
531
|
+
# Fails if <tt>exp == act</tt>.
|
532
|
+
#
|
533
|
+
# For floats use refute_in_delta.
|
534
|
+
|
535
|
+
def refute_equal exp, act, msg = nil
|
536
|
+
msg = message(msg) {
|
537
|
+
"Expected #{mu_pp(act)} to not be equal to #{mu_pp(exp)}"
|
538
|
+
}
|
539
|
+
refute exp == act, msg
|
540
|
+
end
|
541
|
+
|
542
|
+
##
|
543
|
+
# For comparing Floats. Fails if +exp+ is within +delta+ of +act+.
|
544
|
+
#
|
545
|
+
# refute_in_delta Math::PI, (22.0 / 7.0)
|
546
|
+
|
547
|
+
def refute_in_delta exp, act, delta = 0.001, msg = nil
|
548
|
+
n = (exp - act).abs
|
549
|
+
msg = message(msg) {
|
550
|
+
"Expected |#{exp} - #{act}| (#{n}) to not be <= #{delta}"
|
551
|
+
}
|
552
|
+
refute delta >= n, msg
|
553
|
+
end
|
554
|
+
|
555
|
+
##
|
556
|
+
# For comparing Floats. Fails if +exp+ and +act+ have a relative error
|
557
|
+
# less than +epsilon+.
|
558
|
+
|
559
|
+
def refute_in_epsilon a, b, epsilon = 0.001, msg = nil
|
560
|
+
refute_in_delta a, b, a * epsilon, msg
|
561
|
+
end
|
562
|
+
|
563
|
+
##
|
564
|
+
# Fails if +collection+ includes +obj+.
|
565
|
+
|
566
|
+
def refute_includes collection, obj, msg = nil
|
567
|
+
msg = message(msg) {
|
568
|
+
"Expected #{mu_pp(collection)} to not include #{mu_pp(obj)}"
|
569
|
+
}
|
570
|
+
assert_respond_to collection, :include?
|
571
|
+
refute collection.include?(obj), msg
|
572
|
+
end
|
573
|
+
|
574
|
+
##
|
575
|
+
# Fails if +obj+ is an instance of +cls+.
|
576
|
+
|
577
|
+
def refute_instance_of cls, obj, msg = nil
|
578
|
+
msg = message(msg) {
|
579
|
+
"Expected #{mu_pp(obj)} to not be an instance of #{cls}"
|
580
|
+
}
|
581
|
+
refute obj.instance_of?(cls), msg
|
582
|
+
end
|
583
|
+
|
584
|
+
##
|
585
|
+
# Fails if +obj+ is a kind of +cls+.
|
586
|
+
|
587
|
+
def refute_kind_of cls, obj, msg = nil
|
588
|
+
msg = message(msg) { "Expected #{mu_pp(obj)} to not be a kind of #{cls}" }
|
589
|
+
refute obj.kind_of?(cls), msg
|
590
|
+
end
|
591
|
+
|
592
|
+
##
|
593
|
+
# Fails if +matcher+ <tt>=~</tt> +obj+.
|
594
|
+
|
595
|
+
def refute_match matcher, obj, msg = nil
|
596
|
+
msg = message(msg) { "Expected #{mu_pp matcher} to not match #{mu_pp obj}" }
|
597
|
+
assert_respond_to matcher, :"=~"
|
598
|
+
matcher = Regexp.new Regexp.escape matcher if String === matcher
|
599
|
+
refute matcher =~ obj, msg
|
600
|
+
end
|
601
|
+
|
602
|
+
##
|
603
|
+
# Fails if +obj+ is nil.
|
604
|
+
|
605
|
+
def refute_nil obj, msg = nil
|
606
|
+
msg = message(msg) { "Expected #{mu_pp(obj)} to not be nil" }
|
607
|
+
refute obj.nil?, msg
|
608
|
+
end
|
609
|
+
|
610
|
+
##
|
611
|
+
# Fails if +o1+ is not +op+ +o2+. Eg:
|
612
|
+
#
|
613
|
+
# refute_operator 1, :>, 2 #=> pass
|
614
|
+
# refute_operator 1, :<, 2 #=> fail
|
615
|
+
|
616
|
+
def refute_operator o1, op, o2 = UNDEFINED, msg = nil
|
617
|
+
return refute_predicate o1, op, msg if UNDEFINED == o2
|
618
|
+
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}" }
|
619
|
+
refute o1.__send__(op, o2), msg
|
620
|
+
end
|
621
|
+
|
622
|
+
##
|
623
|
+
# For testing with predicates.
|
624
|
+
#
|
625
|
+
# refute_predicate str, :empty?
|
626
|
+
#
|
627
|
+
# This is really meant for specs and is front-ended by refute_operator:
|
628
|
+
#
|
629
|
+
# str.wont_be :empty?
|
630
|
+
|
631
|
+
def refute_predicate o1, op, msg = nil
|
632
|
+
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op}" }
|
633
|
+
refute o1.__send__(op), msg
|
634
|
+
end
|
635
|
+
|
636
|
+
##
|
637
|
+
# Fails if +obj+ responds to the message +meth+.
|
638
|
+
|
639
|
+
def refute_respond_to obj, meth, msg = nil
|
640
|
+
msg = message(msg) { "Expected #{mu_pp(obj)} to not respond to #{meth}" }
|
641
|
+
|
642
|
+
refute obj.respond_to?(meth), msg
|
643
|
+
end
|
644
|
+
|
645
|
+
##
|
646
|
+
# Fails if +exp+ is the same (by object identity) as +act+.
|
647
|
+
|
648
|
+
def refute_same exp, act, msg = nil
|
649
|
+
msg = message(msg) {
|
650
|
+
data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]
|
651
|
+
"Expected %s (oid=%d) to not be the same as %s (oid=%d)" % data
|
652
|
+
}
|
653
|
+
refute exp.equal?(act), msg
|
654
|
+
end
|
655
|
+
|
656
|
+
##
|
657
|
+
# Skips the current run. If run in verbose-mode, the skipped run
|
658
|
+
# gets listed at the end of the run but doesn't cause a failure
|
659
|
+
# exit code.
|
660
|
+
|
661
|
+
def skip msg = nil, bt = caller
|
662
|
+
msg ||= "Skipped, no message given"
|
663
|
+
@skip = true
|
664
|
+
raise Minitest::Skip, msg, bt
|
665
|
+
end
|
666
|
+
|
667
|
+
##
|
668
|
+
# Was this testcase skipped? Meant for #teardown.
|
669
|
+
|
670
|
+
def skipped?
|
671
|
+
defined?(@skip) and @skip
|
672
|
+
end
|
673
|
+
end
|
674
|
+
end
|