mercadopago-custom-checkout 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.gs/bin/rake +23 -0
  4. data/.gs/cache/faraday-0.9.2.gem +0 -0
  5. data/.gs/cache/minitest-5.9.0.gem +0 -0
  6. data/.gs/cache/multi_json-1.12.1.gem +0 -0
  7. data/.gs/cache/multipart-post-2.0.0.gem +0 -0
  8. data/.gs/cache/rake-10.5.0.gem +0 -0
  9. data/.gs/gems/faraday-0.9.2/LICENSE.md +20 -0
  10. data/.gs/gems/faraday-0.9.2/README.md +245 -0
  11. data/.gs/gems/faraday-0.9.2/lib/faraday.rb +268 -0
  12. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter.rb +46 -0
  13. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http.rb +237 -0
  14. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_http_ssl_patch.rb +56 -0
  15. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony.rb +100 -0
  16. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/em_synchrony/parallel_manager.rb +66 -0
  17. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/excon.rb +81 -0
  18. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/httpclient.rb +117 -0
  19. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb +130 -0
  20. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/net_http_persistent.rb +49 -0
  21. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/patron.rb +78 -0
  22. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/rack.rb +58 -0
  23. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/test.rb +162 -0
  24. data/.gs/gems/faraday-0.9.2/lib/faraday/adapter/typhoeus.rb +123 -0
  25. data/.gs/gems/faraday-0.9.2/lib/faraday/autoload.rb +84 -0
  26. data/.gs/gems/faraday-0.9.2/lib/faraday/connection.rb +437 -0
  27. data/.gs/gems/faraday-0.9.2/lib/faraday/error.rb +53 -0
  28. data/.gs/gems/faraday-0.9.2/lib/faraday/middleware.rb +37 -0
  29. data/.gs/gems/faraday-0.9.2/lib/faraday/options.rb +359 -0
  30. data/.gs/gems/faraday-0.9.2/lib/faraday/parameters.rb +197 -0
  31. data/.gs/gems/faraday-0.9.2/lib/faraday/rack_builder.rb +213 -0
  32. data/.gs/gems/faraday-0.9.2/lib/faraday/request.rb +92 -0
  33. data/.gs/gems/faraday-0.9.2/lib/faraday/request/authorization.rb +42 -0
  34. data/.gs/gems/faraday-0.9.2/lib/faraday/request/basic_authentication.rb +13 -0
  35. data/.gs/gems/faraday-0.9.2/lib/faraday/request/instrumentation.rb +36 -0
  36. data/.gs/gems/faraday-0.9.2/lib/faraday/request/multipart.rb +63 -0
  37. data/.gs/gems/faraday-0.9.2/lib/faraday/request/retry.rb +154 -0
  38. data/.gs/gems/faraday-0.9.2/lib/faraday/request/token_authentication.rb +15 -0
  39. data/.gs/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb +36 -0
  40. data/.gs/gems/faraday-0.9.2/lib/faraday/response.rb +93 -0
  41. data/.gs/gems/faraday-0.9.2/lib/faraday/response/logger.rb +59 -0
  42. data/.gs/gems/faraday-0.9.2/lib/faraday/response/raise_error.rb +21 -0
  43. data/.gs/gems/faraday-0.9.2/lib/faraday/upload_io.rb +67 -0
  44. data/.gs/gems/faraday-0.9.2/lib/faraday/utils.rb +309 -0
  45. data/.gs/gems/minitest-5.9.0/.autotest +34 -0
  46. data/.gs/gems/minitest-5.9.0/History.rdoc +1176 -0
  47. data/.gs/gems/minitest-5.9.0/Manifest.txt +26 -0
  48. data/.gs/gems/minitest-5.9.0/README.rdoc +656 -0
  49. data/.gs/gems/minitest-5.9.0/Rakefile +72 -0
  50. data/.gs/gems/minitest-5.9.0/design_rationale.rb +52 -0
  51. data/.gs/gems/minitest-5.9.0/lib/hoe/minitest.rb +26 -0
  52. data/.gs/gems/minitest-5.9.0/lib/minitest.rb +815 -0
  53. data/.gs/gems/minitest-5.9.0/lib/minitest/assertions.rb +674 -0
  54. data/.gs/gems/minitest-5.9.0/lib/minitest/autorun.rb +13 -0
  55. data/.gs/gems/minitest-5.9.0/lib/minitest/benchmark.rb +424 -0
  56. data/.gs/gems/minitest-5.9.0/lib/minitest/expectations.rb +284 -0
  57. data/.gs/gems/minitest-5.9.0/lib/minitest/hell.rb +17 -0
  58. data/.gs/gems/minitest-5.9.0/lib/minitest/mock.rb +232 -0
  59. data/.gs/gems/minitest-5.9.0/lib/minitest/parallel.rb +69 -0
  60. data/.gs/gems/minitest-5.9.0/lib/minitest/pride.rb +4 -0
  61. data/.gs/gems/minitest-5.9.0/lib/minitest/pride_plugin.rb +142 -0
  62. data/.gs/gems/minitest-5.9.0/lib/minitest/spec.rb +331 -0
  63. data/.gs/gems/minitest-5.9.0/lib/minitest/test.rb +284 -0
  64. data/.gs/gems/minitest-5.9.0/lib/minitest/unit.rb +45 -0
  65. data/.gs/gems/minitest-5.9.0/test/minitest/metametameta.rb +90 -0
  66. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_benchmark.rb +137 -0
  67. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_mock.rb +512 -0
  68. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_reporter.rb +281 -0
  69. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_spec.rb +967 -0
  70. data/.gs/gems/minitest-5.9.0/test/minitest/test_minitest_test.rb +1983 -0
  71. data/.gs/gems/multi_json-1.12.1/CHANGELOG.md +245 -0
  72. data/.gs/gems/multi_json-1.12.1/CONTRIBUTING.md +46 -0
  73. data/.gs/gems/multi_json-1.12.1/LICENSE.md +20 -0
  74. data/.gs/gems/multi_json-1.12.1/README.md +121 -0
  75. data/.gs/gems/multi_json-1.12.1/lib/multi_json.rb +161 -0
  76. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter.rb +49 -0
  77. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapter_error.rb +15 -0
  78. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/gson.rb +20 -0
  79. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/jr_jackson.rb +25 -0
  80. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_common.rb +23 -0
  81. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_gem.rb +11 -0
  82. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/json_pure.rb +11 -0
  83. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/nsjsonserialization.rb +32 -0
  84. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/oj.rb +25 -0
  85. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/ok_json.rb +23 -0
  86. data/.gs/gems/multi_json-1.12.1/lib/multi_json/adapters/yajl.rb +19 -0
  87. data/.gs/gems/multi_json-1.12.1/lib/multi_json/convertible_hash_keys.rb +43 -0
  88. data/.gs/gems/multi_json-1.12.1/lib/multi_json/options.rb +39 -0
  89. data/.gs/gems/multi_json-1.12.1/lib/multi_json/options_cache.rb +29 -0
  90. data/.gs/gems/multi_json-1.12.1/lib/multi_json/parse_error.rb +17 -0
  91. data/.gs/gems/multi_json-1.12.1/lib/multi_json/vendor/okjson.rb +606 -0
  92. data/.gs/gems/multi_json-1.12.1/lib/multi_json/version.rb +17 -0
  93. data/.gs/gems/multi_json-1.12.1/multi_json.gemspec +20 -0
  94. data/.gs/gems/multipart-post-2.0.0/.gitignore +6 -0
  95. data/.gs/gems/multipart-post-2.0.0/.travis.yml +7 -0
  96. data/.gs/gems/multipart-post-2.0.0/Gemfile +14 -0
  97. data/.gs/gems/multipart-post-2.0.0/History.txt +60 -0
  98. data/.gs/gems/multipart-post-2.0.0/Manifest.txt +9 -0
  99. data/.gs/gems/multipart-post-2.0.0/README.md +77 -0
  100. data/.gs/gems/multipart-post-2.0.0/Rakefile +9 -0
  101. data/.gs/gems/multipart-post-2.0.0/lib/composite_io.rb +108 -0
  102. data/.gs/gems/multipart-post-2.0.0/lib/multipart_post.rb +9 -0
  103. data/.gs/gems/multipart-post-2.0.0/lib/multipartable.rb +29 -0
  104. data/.gs/gems/multipart-post-2.0.0/lib/net/http/post/multipart.rb +27 -0
  105. data/.gs/gems/multipart-post-2.0.0/lib/parts.rb +96 -0
  106. data/.gs/gems/multipart-post-2.0.0/multipart-post.gemspec +22 -0
  107. data/.gs/gems/multipart-post-2.0.0/test/multibyte.txt +1 -0
  108. data/.gs/gems/multipart-post-2.0.0/test/net/http/post/test_multipart.rb +110 -0
  109. data/.gs/gems/multipart-post-2.0.0/test/test_composite_io.rb +115 -0
  110. data/.gs/gems/multipart-post-2.0.0/test/test_parts.rb +86 -0
  111. data/.gs/gems/rake-10.5.0/.autotest +7 -0
  112. data/.gs/gems/rake-10.5.0/.rubocop.yml +27 -0
  113. data/.gs/gems/rake-10.5.0/.togglerc +7 -0
  114. data/.gs/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  115. data/.gs/gems/rake-10.5.0/History.rdoc +659 -0
  116. data/.gs/gems/rake-10.5.0/MIT-LICENSE +21 -0
  117. data/.gs/gems/rake-10.5.0/Manifest.txt +166 -0
  118. data/.gs/gems/rake-10.5.0/README.rdoc +139 -0
  119. data/.gs/gems/rake-10.5.0/Rakefile +81 -0
  120. data/.gs/gems/rake-10.5.0/bin/rake +33 -0
  121. data/.gs/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
  122. data/.gs/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
  123. data/.gs/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
  124. data/.gs/gems/rake-10.5.0/doc/example/a.c +6 -0
  125. data/.gs/gems/rake-10.5.0/doc/example/b.c +6 -0
  126. data/.gs/gems/rake-10.5.0/doc/example/main.c +11 -0
  127. data/.gs/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
  128. data/.gs/gems/rake-10.5.0/doc/jamis.rb +591 -0
  129. data/.gs/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
  130. data/.gs/gems/rake-10.5.0/doc/rake.1 +141 -0
  131. data/.gs/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
  132. data/.gs/gems/rake-10.5.0/doc/rational.rdoc +151 -0
  133. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
  134. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
  135. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
  136. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
  137. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
  138. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
  139. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
  140. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
  141. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
  142. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
  143. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
  144. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
  145. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
  146. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
  147. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
  148. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
  149. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
  150. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
  151. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
  152. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  153. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
  154. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
  155. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
  156. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
  157. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
  158. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
  159. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
  160. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
  161. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
  162. data/.gs/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
  163. data/.gs/gems/rake-10.5.0/lib/rake.rb +79 -0
  164. data/.gs/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  165. data/.gs/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  166. data/.gs/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  167. data/.gs/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  168. data/.gs/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  169. data/.gs/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  170. data/.gs/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  171. data/.gs/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  172. data/.gs/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  173. data/.gs/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  174. data/.gs/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  175. data/.gs/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  176. data/.gs/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  177. data/.gs/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  178. data/.gs/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  179. data/.gs/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  180. data/.gs/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  181. data/.gs/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  182. data/.gs/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  183. data/.gs/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  184. data/.gs/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  185. data/.gs/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  186. data/.gs/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  187. data/.gs/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  188. data/.gs/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  189. data/.gs/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  190. data/.gs/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  191. data/.gs/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  192. data/.gs/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  193. data/.gs/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  194. data/.gs/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  195. data/.gs/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  196. data/.gs/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  197. data/.gs/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  198. data/.gs/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  199. data/.gs/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  200. data/.gs/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  201. data/.gs/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  202. data/.gs/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  203. data/.gs/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  204. data/.gs/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  205. data/.gs/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  206. data/.gs/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  207. data/.gs/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  208. data/.gs/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  209. data/.gs/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  210. data/.gs/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  211. data/.gs/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  212. data/.gs/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  213. data/.gs/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  214. data/.gs/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  215. data/.gs/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  216. data/.gs/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  217. data/.gs/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  218. data/.gs/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  219. data/.gs/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  220. data/.gs/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  221. data/.gs/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  222. data/.gs/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  223. data/.gs/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  224. data/.gs/gems/rake-10.5.0/test/file_creation.rb +34 -0
  225. data/.gs/gems/rake-10.5.0/test/helper.rb +129 -0
  226. data/.gs/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  227. data/.gs/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  228. data/.gs/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  229. data/.gs/gems/rake-10.5.0/test/test_rake.rb +40 -0
  230. data/.gs/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  231. data/.gs/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  232. data/.gs/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  233. data/.gs/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  234. data/.gs/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  235. data/.gs/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  236. data/.gs/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  237. data/.gs/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  238. data/.gs/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  239. data/.gs/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  240. data/.gs/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  241. data/.gs/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  242. data/.gs/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  243. data/.gs/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  244. data/.gs/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  245. data/.gs/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  246. data/.gs/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  247. data/.gs/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  248. data/.gs/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  249. data/.gs/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  250. data/.gs/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  251. data/.gs/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  252. data/.gs/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  253. data/.gs/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  254. data/.gs/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  255. data/.gs/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  256. data/.gs/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  257. data/.gs/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  258. data/.gs/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  259. data/.gs/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  260. data/.gs/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  261. data/.gs/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  262. data/.gs/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  263. data/.gs/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  264. data/.gs/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  265. data/.gs/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  266. data/.gs/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  267. data/.gs/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  268. data/.gs/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  269. data/.gs/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  270. data/.gs/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  271. data/.gs/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  272. data/.gs/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  273. data/.gs/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  274. data/.gs/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  275. data/.gs/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  276. data/.gs/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  277. data/.gs/specifications/faraday-0.9.2.gemspec +31 -0
  278. data/.gs/specifications/minitest-5.9.0.gemspec +39 -0
  279. data/.gs/specifications/multi_json-1.12.1.gemspec +33 -0
  280. data/.gs/specifications/multipart-post-2.0.0.gemspec +22 -0
  281. data/.gs/specifications/rake-10.5.0.gemspec +43 -0
  282. data/.rubocop.yml +36 -0
  283. data/.ruby-version +1 -0
  284. data/.travis.yml +7 -0
  285. data/CODE_OF_CONDUCT.md +49 -0
  286. data/Gemfile +10 -0
  287. data/LICENSE.txt +21 -0
  288. data/README.md +35 -0
  289. data/Rakefile +38 -0
  290. data/bin/console +14 -0
  291. data/bin/setup +8 -0
  292. data/lib/mercadopago/core/client.rb +70 -0
  293. data/lib/mercadopago/core/endpoints.rb +134 -0
  294. data/lib/mercadopago/core/errors.rb +6 -0
  295. data/lib/mercadopago/core/gateway.rb +84 -0
  296. data/lib/mercadopago/custom_checkout.rb +29 -0
  297. data/lib/mercadopago/custom_checkout/account.rb +162 -0
  298. data/lib/mercadopago/custom_checkout/card_issuer.rb +20 -0
  299. data/lib/mercadopago/custom_checkout/card_token.rb +57 -0
  300. data/lib/mercadopago/custom_checkout/customer.rb +84 -0
  301. data/lib/mercadopago/custom_checkout/errors.rb +6 -0
  302. data/lib/mercadopago/custom_checkout/identification_type.rb +19 -0
  303. data/lib/mercadopago/custom_checkout/payment_method.rb +42 -0
  304. data/lib/mercadopago/custom_checkout/payments.rb +24 -0
  305. data/lib/mercadopago/custom_checkout/resource.rb +14 -0
  306. data/lib/mercadopago/custom_checkout/version.rb +5 -0
  307. data/mercadopago-custom-checkout.gemspec +30 -0
  308. metadata +455 -0
@@ -0,0 +1,72 @@
1
+ # -*- ruby -*-
2
+
3
+ require "rubygems"
4
+ require "hoe"
5
+
6
+ Hoe.plugin :seattlerb
7
+ Hoe.plugin :rdoc
8
+
9
+ Hoe.spec "minitest" do
10
+ developer "Ryan Davis", "ryand-ruby@zenspider.com"
11
+
12
+ license "MIT"
13
+
14
+ self.testlib = :minitest
15
+ end
16
+
17
+ desc "Find missing expectations"
18
+ task :specs do
19
+ $:.unshift "lib"
20
+ require "minitest/unit"
21
+ require "minitest/spec"
22
+
23
+ pos_prefix, neg_prefix = "must", "wont"
24
+ skip_re = /^(must|wont)$|wont_(throw)|must_(block|not?_|nothing|raise$)/x
25
+ dont_flip_re = /(must|wont)_(include|respond_to)/
26
+
27
+ map = {
28
+ /(must_throw)s/ => '\1',
29
+ /(?!not)_same/ => "_be_same_as",
30
+ /_in_/ => "_be_within_",
31
+ /_operator/ => "_be",
32
+ /_includes/ => "_include",
33
+ /(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
34
+ /must_raises/ => "must_raise",
35
+ }
36
+
37
+ expectations = Minitest::Expectations.public_instance_methods.map(&:to_s)
38
+ assertions = Minitest::Assertions.public_instance_methods.map(&:to_s)
39
+
40
+ assertions.sort.each do |assertion|
41
+ expectation = case assertion
42
+ when /^assert/ then
43
+ assertion.sub(/^assert/, pos_prefix.to_s)
44
+ when /^refute/ then
45
+ assertion.sub(/^refute/, neg_prefix.to_s)
46
+ end
47
+
48
+ next unless expectation
49
+ next if expectation =~ skip_re
50
+
51
+ regexp, replacement = map.find { |re, _| expectation =~ re }
52
+ expectation.sub! regexp, replacement if replacement
53
+
54
+ next if expectations.include? expectation
55
+
56
+ args = [assertion, expectation].map(&:to_sym).map(&:inspect)
57
+ args << :reverse if expectation =~ dont_flip_re
58
+
59
+ puts
60
+ puts "##"
61
+ puts "# :method: #{expectation}"
62
+ puts "# See Minitest::Assertions##{assertion}"
63
+ puts
64
+ puts "infect_an_assertion #{args.join ", "}"
65
+ end
66
+ end
67
+
68
+ task :bugs do
69
+ sh "for f in bug*.rb ; do echo $f; echo; #{Gem.ruby} -Ilib $f && rm $f ; done"
70
+ end
71
+
72
+ # vim: syntax=Ruby
@@ -0,0 +1,52 @@
1
+ # Specs: # Equivalent Unit Tests:
2
+ ###############################################################################
3
+ describe Thingy do # class TestThingy < Minitest::Test
4
+ before do # def setup
5
+ do_some_setup # super
6
+ end # do_some_setup
7
+ # end
8
+ it "should do the first thing" do #
9
+ 1.must_equal 1 # def test_first_thing
10
+ end # assert_equal 1, 1
11
+ # end
12
+ describe SubThingy do # end
13
+ before do #
14
+ do_more_setup # class TestSubThingy < TestThingy
15
+ end # def setup
16
+ # super
17
+ it "should do the second thing" do # do_more_setup
18
+ 2.must_equal 2 # end
19
+ end #
20
+ end # def test_second_thing
21
+ end # assert_equal 2, 2
22
+ # end
23
+ # end
24
+ ###############################################################################
25
+ # runs 2 specs # runs 3 tests
26
+ ###############################################################################
27
+ # The specs generate:
28
+
29
+ class ThingySpec < Minitest::Spec
30
+ def setup
31
+ super
32
+ do_some_setup
33
+ end
34
+
35
+ def test_should_do_the_first_thing
36
+ assert_equal 1, 1
37
+ end
38
+ end
39
+
40
+ class SubThingySpec < ThingySpec
41
+ def setup
42
+ super
43
+ do_more_setup
44
+ end
45
+
46
+ # because only setup/teardown is inherited, not specs
47
+ remove_method :test_should_do_the_first_thing
48
+
49
+ def test_should_do_the_second_thing
50
+ assert_equal 2, 2
51
+ end
52
+ end
@@ -0,0 +1,26 @@
1
+ # :stopdoc:
2
+
3
+ class Hoe
4
+ end
5
+
6
+ module Hoe::Minitest
7
+ def initialize_minitest
8
+ dir = "../../minitest/dev/lib"
9
+ Hoe.add_include_dirs dir if File.directory? dir
10
+
11
+ gem "minitest"
12
+ require "minitest"
13
+ version = Minitest::VERSION.split(/\./).first(2).join(".")
14
+
15
+ dependency "minitest", "~> #{version}", :development unless
16
+ self.name == "minitest" or ENV["MT_NO_ISOLATE"]
17
+ end
18
+
19
+ def define_minitest_tasks
20
+ self.testlib = :minitest
21
+
22
+ # make sure we use the gemmed minitest on 1.9
23
+ self.test_prelude = 'gem "minitest"' unless
24
+ self.name == "minitest" or ENV["MT_NO_ISOLATE"]
25
+ end
26
+ end
@@ -0,0 +1,815 @@
1
+ require "optparse"
2
+ require "thread"
3
+ require "mutex_m"
4
+ require "minitest/parallel"
5
+
6
+ ##
7
+ # :include: README.rdoc
8
+
9
+ module Minitest
10
+ VERSION = "5.9.0" # :nodoc:
11
+ ENCS = "".respond_to? :encoding # :nodoc:
12
+
13
+ @@installed_at_exit ||= false
14
+ @@after_run = []
15
+ @extensions = []
16
+
17
+ mc = (class << self; self; end)
18
+
19
+ ##
20
+ # Parallel test executor
21
+
22
+ mc.send :attr_accessor, :parallel_executor
23
+ self.parallel_executor = Parallel::Executor.new((ENV["N"] || 2).to_i)
24
+
25
+ ##
26
+ # Filter object for backtraces.
27
+
28
+ mc.send :attr_accessor, :backtrace_filter
29
+
30
+ ##
31
+ # Reporter object to be used for all runs.
32
+ #
33
+ # NOTE: This accessor is only available during setup, not during runs.
34
+
35
+ mc.send :attr_accessor, :reporter
36
+
37
+ ##
38
+ # Names of known extension plugins.
39
+
40
+ mc.send :attr_accessor, :extensions
41
+
42
+ ##
43
+ # The signal to use for dumping information to STDERR. Defaults to "INFO".
44
+
45
+ mc.send :attr_accessor, :info_signal
46
+ self.info_signal = "INFO"
47
+
48
+ ##
49
+ # Registers Minitest to run at process exit
50
+
51
+ def self.autorun
52
+ at_exit {
53
+ next if $! and not ($!.kind_of? SystemExit and $!.success?)
54
+
55
+ exit_code = nil
56
+
57
+ at_exit {
58
+ @@after_run.reverse_each(&:call)
59
+ exit exit_code || false
60
+ }
61
+
62
+ exit_code = Minitest.run ARGV
63
+ } unless @@installed_at_exit
64
+ @@installed_at_exit = true
65
+ end
66
+
67
+ ##
68
+ # A simple hook allowing you to run a block of code after everything
69
+ # is done running. Eg:
70
+ #
71
+ # Minitest.after_run { p $debugging_info }
72
+
73
+ def self.after_run &block
74
+ @@after_run << block
75
+ end
76
+
77
+ def self.init_plugins options # :nodoc:
78
+ self.extensions.each do |name|
79
+ msg = "plugin_#{name}_init"
80
+ send msg, options if self.respond_to? msg
81
+ end
82
+ end
83
+
84
+ def self.load_plugins # :nodoc:
85
+ return unless self.extensions.empty?
86
+
87
+ seen = {}
88
+
89
+ require "rubygems" unless defined? Gem
90
+
91
+ Gem.find_files("minitest/*_plugin.rb").each do |plugin_path|
92
+ name = File.basename plugin_path, "_plugin.rb"
93
+
94
+ next if seen[name]
95
+ seen[name] = true
96
+
97
+ require plugin_path
98
+ self.extensions << name
99
+ end
100
+ end
101
+
102
+ ##
103
+ # This is the top-level run method. Everything starts from here. It
104
+ # tells each Runnable sub-class to run, and each of those are
105
+ # responsible for doing whatever they do.
106
+ #
107
+ # The overall structure of a run looks like this:
108
+ #
109
+ # Minitest.autorun
110
+ # Minitest.run(args)
111
+ # Minitest.__run(reporter, options)
112
+ # Runnable.runnables.each
113
+ # runnable.run(reporter, options)
114
+ # self.runnable_methods.each
115
+ # self.run_one_method(self, runnable_method, reporter)
116
+ # Minitest.run_one_method(klass, runnable_method)
117
+ # klass.new(runnable_method).run
118
+
119
+ def self.run args = []
120
+ self.load_plugins
121
+
122
+ options = process_args args
123
+
124
+ reporter = CompositeReporter.new
125
+ reporter << SummaryReporter.new(options[:io], options)
126
+ reporter << ProgressReporter.new(options[:io], options)
127
+
128
+ self.reporter = reporter # this makes it available to plugins
129
+ self.init_plugins options
130
+ self.reporter = nil # runnables shouldn't depend on the reporter, ever
131
+
132
+ self.parallel_executor.start if parallel_executor.respond_to?(:start)
133
+ reporter.start
134
+ begin
135
+ __run reporter, options
136
+ rescue Interrupt
137
+ warn "Interrupted. Exiting..."
138
+ end
139
+ self.parallel_executor.shutdown
140
+ reporter.report
141
+
142
+ reporter.passed?
143
+ end
144
+
145
+ ##
146
+ # Internal run method. Responsible for telling all Runnable
147
+ # sub-classes to run.
148
+
149
+ def self.__run reporter, options
150
+ suites = Runnable.runnables.shuffle
151
+ parallel, serial = suites.partition { |s| s.test_order == :parallel }
152
+
153
+ # If we run the parallel tests before the serial tests, the parallel tests
154
+ # could run in parallel with the serial tests. This would be bad because
155
+ # the serial tests won't lock around Reporter#record. Run the serial tests
156
+ # first, so that after they complete, the parallel tests will lock when
157
+ # recording results.
158
+ serial.map { |suite| suite.run reporter, options } +
159
+ parallel.map { |suite| suite.run reporter, options }
160
+ end
161
+
162
+ def self.process_args args = [] # :nodoc:
163
+ options = {
164
+ :io => $stdout,
165
+ }
166
+ orig_args = args.dup
167
+
168
+ OptionParser.new do |opts|
169
+ opts.banner = "minitest options:"
170
+ opts.version = Minitest::VERSION
171
+
172
+ opts.on "-h", "--help", "Display this help." do
173
+ puts opts
174
+ exit
175
+ end
176
+
177
+ desc = "Sets random seed. Also via env. Eg: SEED=n rake"
178
+ opts.on "-s", "--seed SEED", Integer, desc do |m|
179
+ options[:seed] = m.to_i
180
+ end
181
+
182
+ opts.on "-v", "--verbose", "Verbose. Show progress processing files." do
183
+ options[:verbose] = true
184
+ end
185
+
186
+ opts.on "-n", "--name PATTERN", "Filter run on /regexp/ or string." do |a|
187
+ options[:filter] = a
188
+ end
189
+
190
+ opts.on "-e", "--exclude PATTERN", "Exclude /regexp/ or string from run." do |a|
191
+ options[:exclude] = a
192
+ end
193
+
194
+ unless extensions.empty?
195
+ opts.separator ""
196
+ opts.separator "Known extensions: #{extensions.join(", ")}"
197
+
198
+ extensions.each do |meth|
199
+ msg = "plugin_#{meth}_options"
200
+ send msg, opts, options if self.respond_to?(msg)
201
+ end
202
+ end
203
+
204
+ begin
205
+ opts.parse! args
206
+ rescue OptionParser::InvalidOption => e
207
+ puts
208
+ puts e
209
+ puts
210
+ puts opts
211
+ exit 1
212
+ end
213
+
214
+ orig_args -= args
215
+ end
216
+
217
+ unless options[:seed] then
218
+ srand
219
+ options[:seed] = (ENV["SEED"] || srand).to_i % 0xFFFF
220
+ orig_args << "--seed" << options[:seed].to_s
221
+ end
222
+
223
+ srand options[:seed]
224
+
225
+ options[:args] = orig_args.map { |s|
226
+ s =~ /[\s|&<>$()]/ ? s.inspect : s
227
+ }.join " "
228
+
229
+ options
230
+ end
231
+
232
+ def self.filter_backtrace bt # :nodoc:
233
+ backtrace_filter.filter bt
234
+ end
235
+
236
+ ##
237
+ # Represents anything "runnable", like Test, Spec, Benchmark, or
238
+ # whatever you can dream up.
239
+ #
240
+ # Subclasses of this are automatically registered and available in
241
+ # Runnable.runnables.
242
+
243
+ class Runnable
244
+ ##
245
+ # Number of assertions executed in this run.
246
+
247
+ attr_accessor :assertions
248
+
249
+ ##
250
+ # An assertion raised during the run, if any.
251
+
252
+ attr_accessor :failures
253
+
254
+ ##
255
+ # Name of the run.
256
+
257
+ def name
258
+ @NAME
259
+ end
260
+
261
+ ##
262
+ # Set the name of the run.
263
+
264
+ def name= o
265
+ @NAME = o
266
+ end
267
+
268
+ def self.inherited klass # :nodoc:
269
+ self.runnables << klass
270
+ super
271
+ end
272
+
273
+ ##
274
+ # Returns all instance methods matching the pattern +re+.
275
+
276
+ def self.methods_matching re
277
+ public_instance_methods(true).grep(re).map(&:to_s)
278
+ end
279
+
280
+ def self.reset # :nodoc:
281
+ @@runnables = []
282
+ end
283
+
284
+ reset
285
+
286
+ ##
287
+ # Responsible for running all runnable methods in a given class,
288
+ # each in its own instance. Each instance is passed to the
289
+ # reporter to record.
290
+
291
+ def self.run reporter, options = {}
292
+ filter = options[:filter] || "/./"
293
+ filter = Regexp.new $1 if filter =~ %r%/(.*)/%
294
+
295
+ filtered_methods = self.runnable_methods.find_all { |m|
296
+ filter === m || filter === "#{self}##{m}"
297
+ }
298
+
299
+ exclude = options[:exclude]
300
+ exclude = Regexp.new $1 if exclude =~ %r%/(.*)/%
301
+
302
+ filtered_methods.delete_if { |m|
303
+ exclude === m || exclude === "#{self}##{m}"
304
+ }
305
+
306
+ return if filtered_methods.empty?
307
+
308
+ with_info_handler reporter do
309
+ filtered_methods.each do |method_name|
310
+ run_one_method self, method_name, reporter
311
+ end
312
+ end
313
+ end
314
+
315
+ ##
316
+ # Runs a single method and has the reporter record the result.
317
+ # This was considered internal API but is factored out of run so
318
+ # that subclasses can specialize the running of an individual
319
+ # test. See Minitest::ParallelTest::ClassMethods for an example.
320
+
321
+ def self.run_one_method klass, method_name, reporter
322
+ reporter.record Minitest.run_one_method(klass, method_name)
323
+ end
324
+
325
+ def self.with_info_handler reporter, &block # :nodoc:
326
+ handler = lambda do
327
+ unless reporter.passed? then
328
+ warn "Current results:"
329
+ warn ""
330
+ warn reporter.reporters.first
331
+ warn ""
332
+ end
333
+ end
334
+
335
+ on_signal ::Minitest.info_signal, handler, &block
336
+ end
337
+
338
+ SIGNALS = Signal.list # :nodoc:
339
+
340
+ def self.on_signal name, action # :nodoc:
341
+ supported = SIGNALS[name]
342
+
343
+ old_trap = trap name do
344
+ old_trap.call if old_trap.respond_to? :call
345
+ action.call
346
+ end if supported
347
+
348
+ yield
349
+ ensure
350
+ trap name, old_trap if supported
351
+ end
352
+
353
+ ##
354
+ # Each subclass of Runnable is responsible for overriding this
355
+ # method to return all runnable methods. See #methods_matching.
356
+
357
+ def self.runnable_methods
358
+ raise NotImplementedError, "subclass responsibility"
359
+ end
360
+
361
+ ##
362
+ # Returns all subclasses of Runnable.
363
+
364
+ def self.runnables
365
+ @@runnables
366
+ end
367
+
368
+ def marshal_dump # :nodoc:
369
+ [self.name, self.failures, self.assertions]
370
+ end
371
+
372
+ def marshal_load ary # :nodoc:
373
+ self.name, self.failures, self.assertions = ary
374
+ end
375
+
376
+ def failure # :nodoc:
377
+ self.failures.first
378
+ end
379
+
380
+ def initialize name # :nodoc:
381
+ self.name = name
382
+ self.failures = []
383
+ self.assertions = 0
384
+ end
385
+
386
+ ##
387
+ # Runs a single method. Needs to return self.
388
+
389
+ def run
390
+ raise NotImplementedError, "subclass responsibility"
391
+ end
392
+
393
+ ##
394
+ # Did this run pass?
395
+ #
396
+ # Note: skipped runs are not considered passing, but they don't
397
+ # cause the process to exit non-zero.
398
+
399
+ def passed?
400
+ raise NotImplementedError, "subclass responsibility"
401
+ end
402
+
403
+ ##
404
+ # Returns a single character string to print based on the result
405
+ # of the run. Eg ".", "F", or "E".
406
+
407
+ def result_code
408
+ raise NotImplementedError, "subclass responsibility"
409
+ end
410
+
411
+ ##
412
+ # Was this run skipped? See #passed? for more information.
413
+
414
+ def skipped?
415
+ raise NotImplementedError, "subclass responsibility"
416
+ end
417
+ end
418
+
419
+ ##
420
+ # Defines the API for Reporters. Subclass this and override whatever
421
+ # you want. Go nuts.
422
+
423
+ class AbstractReporter
424
+ include Mutex_m
425
+
426
+ ##
427
+ # Starts reporting on the run.
428
+
429
+ def start
430
+ end
431
+
432
+ ##
433
+ # Record a result and output the Runnable#result_code. Stores the
434
+ # result of the run if the run did not pass.
435
+
436
+ def record result
437
+ end
438
+
439
+ ##
440
+ # Outputs the summary of the run.
441
+
442
+ def report
443
+ end
444
+
445
+ ##
446
+ # Did this run pass?
447
+
448
+ def passed?
449
+ true
450
+ end
451
+ end
452
+
453
+ class Reporter < AbstractReporter # :nodoc:
454
+ ##
455
+ # The IO used to report.
456
+
457
+ attr_accessor :io
458
+
459
+ ##
460
+ # Command-line options for this run.
461
+
462
+ attr_accessor :options
463
+
464
+ def initialize io = $stdout, options = {} # :nodoc:
465
+ super()
466
+ self.io = io
467
+ self.options = options
468
+ end
469
+ end
470
+
471
+ ##
472
+ # A very simple reporter that prints the "dots" during the run.
473
+ #
474
+ # This is added to the top-level CompositeReporter at the start of
475
+ # the run. If you want to change the output of minitest via a
476
+ # plugin, pull this out of the composite and replace it with your
477
+ # own.
478
+
479
+ class ProgressReporter < Reporter
480
+ def record result # :nodoc:
481
+ io.print "%s#%s = %.2f s = " % [result.class, result.name, result.time] if
482
+ options[:verbose]
483
+ io.print result.result_code
484
+ io.puts if options[:verbose]
485
+ end
486
+ end
487
+
488
+ ##
489
+ # A reporter that gathers statistics about a test run. Does not do
490
+ # any IO because meant to be used as a parent class for a reporter
491
+ # that does.
492
+ #
493
+ # If you want to create an entirely different type of output (eg,
494
+ # CI, HTML, etc), this is the place to start.
495
+
496
+ class StatisticsReporter < Reporter
497
+ # :stopdoc:
498
+ attr_accessor :assertions
499
+ attr_accessor :count
500
+ attr_accessor :results
501
+ attr_accessor :start_time
502
+ attr_accessor :total_time
503
+ attr_accessor :failures
504
+ attr_accessor :errors
505
+ attr_accessor :skips
506
+ # :startdoc:
507
+
508
+ def initialize io = $stdout, options = {} # :nodoc:
509
+ super
510
+
511
+ self.assertions = 0
512
+ self.count = 0
513
+ self.results = []
514
+ self.start_time = nil
515
+ self.total_time = nil
516
+ self.failures = nil
517
+ self.errors = nil
518
+ self.skips = nil
519
+ end
520
+
521
+ def passed? # :nodoc:
522
+ results.all?(&:skipped?)
523
+ end
524
+
525
+ def start # :nodoc:
526
+ self.start_time = Minitest.clock_time
527
+ end
528
+
529
+ def record result # :nodoc:
530
+ self.count += 1
531
+ self.assertions += result.assertions
532
+
533
+ results << result if not result.passed? or result.skipped?
534
+ end
535
+
536
+ def report # :nodoc:
537
+ aggregate = results.group_by { |r| r.failure.class }
538
+ aggregate.default = [] # dumb. group_by should provide this
539
+
540
+ self.total_time = Minitest.clock_time - start_time
541
+ self.failures = aggregate[Assertion].size
542
+ self.errors = aggregate[UnexpectedError].size
543
+ self.skips = aggregate[Skip].size
544
+ end
545
+ end
546
+
547
+ ##
548
+ # A reporter that prints the header, summary, and failure details at
549
+ # the end of the run.
550
+ #
551
+ # This is added to the top-level CompositeReporter at the start of
552
+ # the run. If you want to change the output of minitest via a
553
+ # plugin, pull this out of the composite and replace it with your
554
+ # own.
555
+
556
+ class SummaryReporter < StatisticsReporter
557
+ # :stopdoc:
558
+ attr_accessor :sync
559
+ attr_accessor :old_sync
560
+ # :startdoc:
561
+
562
+ def start # :nodoc:
563
+ super
564
+
565
+ io.puts "Run options: #{options[:args]}"
566
+ io.puts
567
+ io.puts "# Running:"
568
+ io.puts
569
+
570
+ self.sync = io.respond_to? :"sync=" # stupid emacs
571
+ self.old_sync, io.sync = io.sync, true if self.sync
572
+ end
573
+
574
+ def report # :nodoc:
575
+ super
576
+
577
+ io.sync = self.old_sync
578
+
579
+ io.puts unless options[:verbose] # finish the dots
580
+ io.puts
581
+ io.puts statistics
582
+ io.puts aggregated_results
583
+ io.puts summary
584
+ end
585
+
586
+ def statistics # :nodoc:
587
+ "Finished in %.6fs, %.4f runs/s, %.4f assertions/s." %
588
+ [total_time, count / total_time, assertions / total_time]
589
+ end
590
+
591
+ def aggregated_results # :nodoc:
592
+ filtered_results = results.dup
593
+ filtered_results.reject!(&:skipped?) unless options[:verbose]
594
+
595
+ s = filtered_results.each_with_index.map { |result, i|
596
+ "\n%3d) %s" % [i+1, result]
597
+ }.join("\n") + "\n"
598
+
599
+ s.force_encoding(io.external_encoding) if
600
+ ENCS and io.external_encoding and s.encoding != io.external_encoding
601
+
602
+ s
603
+ end
604
+
605
+ alias to_s aggregated_results
606
+
607
+ def summary # :nodoc:
608
+ extra = ""
609
+
610
+ extra = "\n\nYou have skipped tests. Run with --verbose for details." if
611
+ results.any?(&:skipped?) unless options[:verbose] or ENV["MT_NO_SKIP_MSG"]
612
+
613
+ "%d runs, %d assertions, %d failures, %d errors, %d skips%s" %
614
+ [count, assertions, failures, errors, skips, extra]
615
+ end
616
+ end
617
+
618
+ ##
619
+ # Dispatch to multiple reporters as one.
620
+
621
+ class CompositeReporter < AbstractReporter
622
+ ##
623
+ # The list of reporters to dispatch to.
624
+
625
+ attr_accessor :reporters
626
+
627
+ def initialize *reporters # :nodoc:
628
+ super()
629
+ self.reporters = reporters
630
+ end
631
+
632
+ def io # :nodoc:
633
+ reporters.first.io
634
+ end
635
+
636
+ ##
637
+ # Add another reporter to the mix.
638
+
639
+ def << reporter
640
+ self.reporters << reporter
641
+ end
642
+
643
+ def passed? # :nodoc:
644
+ self.reporters.all?(&:passed?)
645
+ end
646
+
647
+ def start # :nodoc:
648
+ self.reporters.each(&:start)
649
+ end
650
+
651
+ def record result # :nodoc:
652
+ self.reporters.each do |reporter|
653
+ reporter.record result
654
+ end
655
+ end
656
+
657
+ def report # :nodoc:
658
+ self.reporters.each(&:report)
659
+ end
660
+ end
661
+
662
+ ##
663
+ # Represents run failures.
664
+
665
+ class Assertion < Exception
666
+ def error # :nodoc:
667
+ self
668
+ end
669
+
670
+ ##
671
+ # Where was this run before an assertion was raised?
672
+
673
+ def location
674
+ last_before_assertion = ""
675
+ self.backtrace.reverse_each do |s|
676
+ break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/
677
+ last_before_assertion = s
678
+ end
679
+ last_before_assertion.sub(/:in .*$/, "")
680
+ end
681
+
682
+ def result_code # :nodoc:
683
+ result_label[0, 1]
684
+ end
685
+
686
+ def result_label # :nodoc:
687
+ "Failure"
688
+ end
689
+ end
690
+
691
+ ##
692
+ # Assertion raised when skipping a run.
693
+
694
+ class Skip < Assertion
695
+ def result_label # :nodoc:
696
+ "Skipped"
697
+ end
698
+ end
699
+
700
+ ##
701
+ # Assertion wrapping an unexpected error that was raised during a run.
702
+
703
+ class UnexpectedError < Assertion
704
+ attr_accessor :exception # :nodoc:
705
+
706
+ def initialize exception # :nodoc:
707
+ super "Unexpected exception"
708
+ self.exception = exception
709
+ end
710
+
711
+ def backtrace # :nodoc:
712
+ self.exception.backtrace
713
+ end
714
+
715
+ def error # :nodoc:
716
+ self.exception
717
+ end
718
+
719
+ def message # :nodoc:
720
+ bt = Minitest.filter_backtrace(self.backtrace).join "\n "
721
+ "#{self.exception.class}: #{self.exception.message}\n #{bt}"
722
+ end
723
+
724
+ def result_label # :nodoc:
725
+ "Error"
726
+ end
727
+ end
728
+
729
+ ##
730
+ # Provides a simple set of guards that you can use in your tests
731
+ # to skip execution if it is not applicable. These methods are
732
+ # mixed into Test as both instance and class methods so you
733
+ # can use them inside or outside of the test methods.
734
+ #
735
+ # def test_something_for_mri
736
+ # skip "bug 1234" if jruby?
737
+ # # ...
738
+ # end
739
+ #
740
+ # if windows? then
741
+ # # ... lots of test methods ...
742
+ # end
743
+
744
+ module Guard
745
+
746
+ ##
747
+ # Is this running on jruby?
748
+
749
+ def jruby? platform = RUBY_PLATFORM
750
+ "java" == platform
751
+ end
752
+
753
+ ##
754
+ # Is this running on maglev?
755
+
756
+ def maglev? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
757
+ "maglev" == platform
758
+ end
759
+
760
+ ##
761
+ # Is this running on mri?
762
+
763
+ def mri? platform = RUBY_DESCRIPTION
764
+ /^ruby/ =~ platform
765
+ end
766
+
767
+ ##
768
+ # Is this running on rubinius?
769
+
770
+ def rubinius? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
771
+ "rbx" == platform
772
+ end
773
+
774
+ ##
775
+ # Is this running on windows?
776
+
777
+ def windows? platform = RUBY_PLATFORM
778
+ /mswin|mingw/ =~ platform
779
+ end
780
+ end
781
+
782
+ class BacktraceFilter # :nodoc:
783
+ def filter bt
784
+ return ["No backtrace"] unless bt
785
+
786
+ return bt.dup if $DEBUG
787
+
788
+ new_bt = bt.take_while { |line| line !~ /lib\/minitest/ }
789
+ new_bt = bt.select { |line| line !~ /lib\/minitest/ } if new_bt.empty?
790
+ new_bt = bt.dup if new_bt.empty?
791
+
792
+ new_bt
793
+ end
794
+ end
795
+
796
+ self.backtrace_filter = BacktraceFilter.new
797
+
798
+ def self.run_one_method klass, method_name # :nodoc:
799
+ result = klass.new(method_name).run
800
+ raise "#{klass}#run _must_ return self" unless klass === result
801
+ result
802
+ end
803
+
804
+ if defined? Process::CLOCK_MONOTONIC
805
+ def self.clock_time
806
+ Process.clock_gettime Process::CLOCK_MONOTONIC
807
+ end
808
+ else
809
+ def self.clock_time
810
+ Time.now
811
+ end
812
+ end
813
+ end
814
+
815
+ require "minitest/test"