hatena_bookmark_client_for_ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (453) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +35 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +39 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/hatena_bookmark_client_for_ruby.gemspec +30 -0
  13. data/lib/hatena_bookmark_client_for_ruby.rb +10 -0
  14. data/lib/hatena_bookmark_client_for_ruby/version.rb +3 -0
  15. data/shell/exe/sample +5 -0
  16. data/vendor/bundle/ruby/2.6.0/bin/htmldiff +29 -0
  17. data/vendor/bundle/ruby/2.6.0/bin/ldiff +29 -0
  18. data/vendor/bundle/ruby/2.6.0/bin/rake +27 -0
  19. data/vendor/bundle/ruby/2.6.0/bin/rspec +27 -0
  20. data/vendor/bundle/ruby/2.6.0/cache/diff-lcs-1.3.gem +0 -0
  21. data/vendor/bundle/ruby/2.6.0/cache/rake-10.5.0.gem +0 -0
  22. data/vendor/bundle/ruby/2.6.0/cache/rspec-3.8.0.gem +0 -0
  23. data/vendor/bundle/ruby/2.6.0/cache/rspec-core-3.8.0.gem +0 -0
  24. data/vendor/bundle/ruby/2.6.0/cache/rspec-expectations-3.8.2.gem +0 -0
  25. data/vendor/bundle/ruby/2.6.0/cache/rspec-mocks-3.8.0.gem +0 -0
  26. data/vendor/bundle/ruby/2.6.0/cache/rspec-support-3.8.0.gem +0 -0
  27. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/.rspec +1 -0
  28. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/Code-of-Conduct.md +74 -0
  29. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/Contributing.md +83 -0
  30. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/History.md +220 -0
  31. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/License.md +39 -0
  32. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/Manifest.txt +37 -0
  33. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/README.rdoc +84 -0
  34. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/Rakefile +57 -0
  35. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/autotest/discover.rb +1 -0
  36. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/bin/htmldiff +32 -0
  37. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/bin/ldiff +6 -0
  38. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/docs/COPYING.txt +339 -0
  39. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/docs/artistic.txt +127 -0
  40. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff-lcs.rb +3 -0
  41. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs.rb +725 -0
  42. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/array.rb +7 -0
  43. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/block.rb +37 -0
  44. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/callbacks.rb +322 -0
  45. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/change.rb +181 -0
  46. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/htmldiff.rb +149 -0
  47. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/hunk.rb +276 -0
  48. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/internals.rb +307 -0
  49. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/ldiff.rb +167 -0
  50. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/string.rb +5 -0
  51. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/change_spec.rb +65 -0
  52. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/diff_spec.rb +47 -0
  53. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/fixtures/ds1.csv +50 -0
  54. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/fixtures/ds2.csv +51 -0
  55. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/hunk_spec.rb +72 -0
  56. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/issues_spec.rb +49 -0
  57. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/lcs_spec.rb +56 -0
  58. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/ldiff_spec.rb +47 -0
  59. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/patch_spec.rb +422 -0
  60. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/sdiff_spec.rb +214 -0
  61. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/spec_helper.rb +321 -0
  62. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/traverse_balanced_spec.rb +310 -0
  63. data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/traverse_sequences_spec.rb +139 -0
  64. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/.autotest +7 -0
  65. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/.rubocop.yml +27 -0
  66. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/.togglerc +7 -0
  67. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  68. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/History.rdoc +659 -0
  69. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/MIT-LICENSE +21 -0
  70. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/Manifest.txt +166 -0
  71. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/README.rdoc +139 -0
  72. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/Rakefile +81 -0
  73. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/bin/rake +33 -0
  74. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
  75. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
  76. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
  77. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/example/a.c +6 -0
  78. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/example/b.c +6 -0
  79. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/example/main.c +11 -0
  80. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
  81. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/jamis.rb +591 -0
  82. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
  83. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/rake.1 +141 -0
  84. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
  85. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/rational.rdoc +151 -0
  86. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
  87. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
  88. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
  89. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
  90. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
  91. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
  92. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
  93. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
  94. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
  95. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
  96. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
  97. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
  98. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
  99. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
  100. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
  101. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
  102. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
  103. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
  104. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
  105. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  106. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
  107. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
  108. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
  109. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
  110. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
  111. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
  112. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
  113. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
  114. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
  115. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
  116. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake.rb +79 -0
  117. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  118. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  119. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  120. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  121. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  122. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  123. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  124. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  125. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  126. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  127. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  128. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  129. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  130. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  131. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  132. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  133. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  134. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  135. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  136. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  137. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  138. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  139. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  140. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  141. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  142. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  143. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  144. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  145. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  146. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  147. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  148. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  149. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  150. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  151. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  152. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  153. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  154. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  155. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  156. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  157. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  158. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  159. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  160. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  161. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  162. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  163. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  164. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  165. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  166. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  167. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  168. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  169. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  170. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  171. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  172. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  173. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  174. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  175. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  176. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  177. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/file_creation.rb +34 -0
  178. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/helper.rb +129 -0
  179. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  180. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  181. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  182. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake.rb +40 -0
  183. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  184. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  185. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  186. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  187. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  188. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  189. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  190. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  191. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  192. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  193. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  194. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  195. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  196. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  197. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  198. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  199. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  200. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  201. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  202. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  203. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  204. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  205. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  206. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  207. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  208. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  209. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  210. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  211. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  212. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  213. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  214. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  215. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  216. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  217. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  218. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  219. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  220. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  221. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  222. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  223. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  224. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  225. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  226. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  227. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  228. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  229. data/vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  230. data/vendor/bundle/ruby/2.6.0/gems/rspec-3.8.0/LICENSE.md +27 -0
  231. data/vendor/bundle/ruby/2.6.0/gems/rspec-3.8.0/README.md +43 -0
  232. data/vendor/bundle/ruby/2.6.0/gems/rspec-3.8.0/lib/rspec.rb +3 -0
  233. data/vendor/bundle/ruby/2.6.0/gems/rspec-3.8.0/lib/rspec/version.rb +5 -0
  234. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/.document +5 -0
  235. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/.yardopts +8 -0
  236. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/Changelog.md +2221 -0
  237. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/LICENSE.md +26 -0
  238. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/README.md +384 -0
  239. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/exe/rspec +4 -0
  240. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/autorun.rb +3 -0
  241. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core.rb +185 -0
  242. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/backtrace_formatter.rb +65 -0
  243. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/coordinator.rb +62 -0
  244. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/example_minimizer.rb +173 -0
  245. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/fork_runner.rb +134 -0
  246. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/server.rb +61 -0
  247. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/shell_command.rb +126 -0
  248. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/shell_runner.rb +73 -0
  249. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/bisect/utilities.rb +58 -0
  250. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb +2289 -0
  251. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/configuration_options.rb +233 -0
  252. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/drb.rb +113 -0
  253. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/dsl.rb +98 -0
  254. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/example.rb +653 -0
  255. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb +885 -0
  256. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/example_status_persister.rb +235 -0
  257. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/filter_manager.rb +231 -0
  258. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/flat_map.rb +20 -0
  259. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb +269 -0
  260. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/base_bisect_formatter.rb +45 -0
  261. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/base_formatter.rb +70 -0
  262. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/base_text_formatter.rb +75 -0
  263. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/bisect_drb_formatter.rb +29 -0
  264. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/bisect_progress_formatter.rb +157 -0
  265. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/console_codes.rb +68 -0
  266. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
  267. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/documentation_formatter.rb +70 -0
  268. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/exception_presenter.rb +497 -0
  269. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
  270. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/helpers.rb +110 -0
  271. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/html_formatter.rb +153 -0
  272. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/html_printer.rb +414 -0
  273. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/html_snippet_extractor.rb +120 -0
  274. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/json_formatter.rb +102 -0
  275. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/profile_formatter.rb +68 -0
  276. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/progress_formatter.rb +29 -0
  277. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/protocol.rb +182 -0
  278. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/snippet_extractor.rb +134 -0
  279. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
  280. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/hooks.rb +624 -0
  281. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/invocations.rb +87 -0
  282. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/memoized_helpers.rb +535 -0
  283. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/metadata.rb +499 -0
  284. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/metadata_filter.rb +255 -0
  285. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
  286. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
  287. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
  288. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/mocking_adapters/null.rb +14 -0
  289. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/mocking_adapters/rr.rb +31 -0
  290. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
  291. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/notifications.rb +521 -0
  292. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/option_parser.rb +309 -0
  293. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/ordering.rb +158 -0
  294. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/output_wrapper.rb +29 -0
  295. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/pending.rb +165 -0
  296. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/profiler.rb +34 -0
  297. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/project_initializer.rb +48 -0
  298. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/project_initializer/.rspec +1 -0
  299. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/project_initializer/spec/spec_helper.rb +100 -0
  300. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/rake_task.rb +168 -0
  301. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb +257 -0
  302. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/ruby_project.rb +53 -0
  303. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb +199 -0
  304. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/sandbox.rb +37 -0
  305. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/set.rb +54 -0
  306. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/shared_context.rb +55 -0
  307. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/shared_example_group.rb +269 -0
  308. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/shell_escape.rb +49 -0
  309. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
  310. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/version.rb +9 -0
  311. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/warnings.rb +40 -0
  312. data/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/world.rb +275 -0
  313. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/.document +5 -0
  314. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/.yardopts +6 -0
  315. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/Changelog.md +1120 -0
  316. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/LICENSE.md +25 -0
  317. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/README.md +305 -0
  318. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations.rb +82 -0
  319. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
  320. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/configuration.rb +215 -0
  321. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/expectation_target.rb +127 -0
  322. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/fail_with.rb +39 -0
  323. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/failure_aggregator.rb +194 -0
  324. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/handler.rb +170 -0
  325. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/minitest_integration.rb +58 -0
  326. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/syntax.rb +132 -0
  327. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/expectations/version.rb +8 -0
  328. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers.rb +1034 -0
  329. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/aliased_matcher.rb +116 -0
  330. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in.rb +52 -0
  331. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/all.rb +85 -0
  332. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/base_matcher.rb +193 -0
  333. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/be.rb +288 -0
  334. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/be_between.rb +77 -0
  335. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/be_instance_of.rb +22 -0
  336. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/be_kind_of.rb +16 -0
  337. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/be_within.rb +72 -0
  338. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/change.rb +426 -0
  339. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/compound.rb +271 -0
  340. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/contain_exactly.rb +302 -0
  341. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/cover.rb +24 -0
  342. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/eq.rb +40 -0
  343. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/eql.rb +34 -0
  344. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/equal.rb +81 -0
  345. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/exist.rb +90 -0
  346. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/has.rb +103 -0
  347. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
  348. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/include.rb +149 -0
  349. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/match.rb +106 -0
  350. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/operators.rb +128 -0
  351. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/output.rb +200 -0
  352. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/raise_error.rb +230 -0
  353. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/respond_to.rb +165 -0
  354. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/satisfy.rb +60 -0
  355. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
  356. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
  357. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/built_in/yield.rb +432 -0
  358. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/composable.rb +171 -0
  359. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/dsl.rb +527 -0
  360. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/english_phrasing.rb +58 -0
  361. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +73 -0
  362. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/fail_matchers.rb +42 -0
  363. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/generated_descriptions.rb +41 -0
  364. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/matcher_delegator.rb +35 -0
  365. data/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.8.2/lib/rspec/matchers/matcher_protocol.rb +99 -0
  366. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/.document +5 -0
  367. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/.yardopts +6 -0
  368. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/Changelog.md +1100 -0
  369. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/LICENSE.md +25 -0
  370. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/README.md +460 -0
  371. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks.rb +130 -0
  372. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance.rb +11 -0
  373. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/chain.rb +110 -0
  374. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
  375. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/expect_chain_chain.rb +31 -0
  376. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/expectation_chain.rb +50 -0
  377. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
  378. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/proxy.rb +116 -0
  379. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/recorder.rb +289 -0
  380. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/stub_chain.rb +51 -0
  381. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/any_instance/stub_chain_chain.rb +23 -0
  382. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/argument_list_matcher.rb +100 -0
  383. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/argument_matchers.rb +320 -0
  384. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/configuration.rb +212 -0
  385. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/error_generator.rb +369 -0
  386. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/example_methods.rb +434 -0
  387. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/instance_method_stasher.rb +146 -0
  388. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/marshal_extension.rb +41 -0
  389. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
  390. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/matchers/have_received.rb +134 -0
  391. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/matchers/receive.rb +132 -0
  392. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/matchers/receive_message_chain.rb +82 -0
  393. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/matchers/receive_messages.rb +77 -0
  394. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/message_chain.rb +87 -0
  395. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/message_expectation.rb +741 -0
  396. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/method_double.rb +287 -0
  397. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/method_reference.rb +202 -0
  398. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/minitest_integration.rb +68 -0
  399. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/mutate_const.rb +339 -0
  400. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/object_reference.rb +149 -0
  401. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/order_group.rb +81 -0
  402. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/proxy.rb +485 -0
  403. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/space.rb +238 -0
  404. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/standalone.rb +3 -0
  405. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/syntax.rb +325 -0
  406. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/targets.rb +124 -0
  407. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/test_double.rb +171 -0
  408. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/verifying_double.rb +129 -0
  409. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/verifying_message_expectation.rb +54 -0
  410. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/verifying_proxy.rb +220 -0
  411. data/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.8.0/lib/rspec/mocks/version.rb +9 -0
  412. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/Changelog.md +242 -0
  413. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/LICENSE.md +23 -0
  414. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/README.md +40 -0
  415. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support.rb +149 -0
  416. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/caller_filter.rb +83 -0
  417. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/comparable_version.rb +46 -0
  418. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/differ.rb +215 -0
  419. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/directory_maker.rb +63 -0
  420. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/encoded_string.rb +165 -0
  421. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
  422. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/hunk_generator.rb +47 -0
  423. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/matcher_definition.rb +42 -0
  424. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/method_signature_verifier.rb +426 -0
  425. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/mutex.rb +73 -0
  426. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/object_formatter.rb +275 -0
  427. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/recursive_const_methods.rb +76 -0
  428. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/reentrant_mutex.rb +53 -0
  429. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/ruby_features.rb +176 -0
  430. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/source.rb +75 -0
  431. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/source/location.rb +21 -0
  432. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/source/node.rb +110 -0
  433. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/source/token.rb +87 -0
  434. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec.rb +81 -0
  435. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
  436. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/formatting_support.rb +9 -0
  437. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/in_sub_process.rb +69 -0
  438. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/library_wide_checks.rb +150 -0
  439. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/shell_out.rb +84 -0
  440. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/stderr_splitter.rb +63 -0
  441. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/string_matcher.rb +46 -0
  442. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/with_isolated_directory.rb +13 -0
  443. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
  444. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/version.rb +7 -0
  445. data/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.8.0/lib/rspec/support/warnings.rb +39 -0
  446. data/vendor/bundle/ruby/2.6.0/specifications/diff-lcs-1.3.gemspec +61 -0
  447. data/vendor/bundle/ruby/2.6.0/specifications/rake-10.5.0.gemspec +43 -0
  448. data/vendor/bundle/ruby/2.6.0/specifications/rspec-3.8.0.gemspec +42 -0
  449. data/vendor/bundle/ruby/2.6.0/specifications/rspec-core-3.8.0.gemspec +62 -0
  450. data/vendor/bundle/ruby/2.6.0/specifications/rspec-expectations-3.8.2.gemspec +50 -0
  451. data/vendor/bundle/ruby/2.6.0/specifications/rspec-mocks-3.8.0.gemspec +50 -0
  452. data/vendor/bundle/ruby/2.6.0/specifications/rspec-support-3.8.0.gemspec +41 -0
  453. metadata +536 -0
@@ -0,0 +1,82 @@
1
+ RSpec::Support.require_rspec_mocks 'matchers/expectation_customization'
2
+
3
+ module RSpec
4
+ module Mocks
5
+ module Matchers
6
+ # @private
7
+ class ReceiveMessageChain
8
+ include Matcher
9
+
10
+ def initialize(chain, &block)
11
+ @chain = chain
12
+ @block = block
13
+ @recorded_customizations = []
14
+ end
15
+
16
+ [:with, :and_return, :and_throw, :and_raise, :and_yield, :and_call_original].each do |msg|
17
+ define_method(msg) do |*args, &block|
18
+ @recorded_customizations << ExpectationCustomization.new(msg, args, block)
19
+ self
20
+ end
21
+ end
22
+
23
+ def name
24
+ "receive_message_chain"
25
+ end
26
+
27
+ def description
28
+ "receive message chain #{formatted_chain}"
29
+ end
30
+
31
+ def setup_allowance(subject, &block)
32
+ chain = StubChain.stub_chain_on(subject, *@chain, &(@block || block))
33
+ replay_customizations(chain)
34
+ end
35
+
36
+ def setup_any_instance_allowance(subject, &block)
37
+ proxy = ::RSpec::Mocks.space.any_instance_proxy_for(subject)
38
+ chain = proxy.stub_chain(*@chain, &(@block || block))
39
+ replay_customizations(chain)
40
+ end
41
+
42
+ def setup_any_instance_expectation(subject, &block)
43
+ proxy = ::RSpec::Mocks.space.any_instance_proxy_for(subject)
44
+ chain = proxy.expect_chain(*@chain, &(@block || block))
45
+ replay_customizations(chain)
46
+ end
47
+
48
+ def setup_expectation(subject, &block)
49
+ chain = ExpectChain.expect_chain_on(subject, *@chain, &(@block || block))
50
+ replay_customizations(chain)
51
+ end
52
+
53
+ def setup_negative_expectation(*_args)
54
+ raise NegationUnsupportedError,
55
+ "`expect(...).not_to receive_message_chain` is not supported " \
56
+ "since it doesn't really make sense. What would it even mean?"
57
+ end
58
+
59
+ alias matches? setup_expectation
60
+ alias does_not_match? setup_negative_expectation
61
+
62
+ private
63
+
64
+ def replay_customizations(chain)
65
+ @recorded_customizations.each do |customization|
66
+ customization.playback_onto(chain)
67
+ end
68
+ end
69
+
70
+ def formatted_chain
71
+ @formatted_chain ||= @chain.map do |part|
72
+ if Hash === part
73
+ part.keys.first.to_s
74
+ else
75
+ part.to_s
76
+ end
77
+ end.join(".")
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,77 @@
1
+ module RSpec
2
+ module Mocks
3
+ module Matchers
4
+ # @private
5
+ class ReceiveMessages
6
+ include Matcher
7
+
8
+ def initialize(message_return_value_hash)
9
+ @message_return_value_hash = message_return_value_hash
10
+ @backtrace_line = CallerFilter.first_non_rspec_line
11
+ end
12
+
13
+ def name
14
+ "receive_messages"
15
+ end
16
+
17
+ def description
18
+ "receive messages: #{@message_return_value_hash.inspect}"
19
+ end
20
+
21
+ def setup_expectation(subject)
22
+ warn_about_block if block_given?
23
+ each_message_on(proxy_on(subject)) do |host, message, return_value|
24
+ host.add_simple_expectation(message, return_value, @backtrace_line)
25
+ end
26
+ end
27
+ alias matches? setup_expectation
28
+
29
+ def setup_negative_expectation(_subject)
30
+ raise NegationUnsupportedError,
31
+ "`expect(...).to_not receive_messages` is not supported since it " \
32
+ "doesn't really make sense. What would it even mean?"
33
+ end
34
+ alias does_not_match? setup_negative_expectation
35
+
36
+ def setup_allowance(subject)
37
+ warn_about_block if block_given?
38
+ each_message_on(proxy_on(subject)) do |host, message, return_value|
39
+ host.add_simple_stub(message, return_value)
40
+ end
41
+ end
42
+
43
+ def setup_any_instance_expectation(subject)
44
+ warn_about_block if block_given?
45
+ each_message_on(any_instance_of(subject)) do |host, message, return_value|
46
+ host.should_receive(message).and_return(return_value)
47
+ end
48
+ end
49
+
50
+ def setup_any_instance_allowance(subject)
51
+ warn_about_block if block_given?
52
+ any_instance_of(subject).stub(@message_return_value_hash)
53
+ end
54
+
55
+ def warn_about_block
56
+ raise "Implementation blocks aren't supported with `receive_messages`"
57
+ end
58
+
59
+ private
60
+
61
+ def proxy_on(subject)
62
+ ::RSpec::Mocks.space.proxy_for(subject)
63
+ end
64
+
65
+ def any_instance_of(subject)
66
+ ::RSpec::Mocks.space.any_instance_proxy_for(subject)
67
+ end
68
+
69
+ def each_message_on(host)
70
+ @message_return_value_hash.each do |message, value|
71
+ yield host, message, value
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,87 @@
1
+ module RSpec
2
+ module Mocks
3
+ # @private
4
+ class MessageChain
5
+ attr_reader :object, :chain, :block
6
+
7
+ def initialize(object, *chain, &blk)
8
+ @object = object
9
+ @chain, @block = format_chain(*chain, &blk)
10
+ end
11
+
12
+ # @api private
13
+ def setup_chain
14
+ if chain.length > 1
15
+ if (matching_stub = find_matching_stub)
16
+ chain.shift
17
+ chain_on(matching_stub.invoke(nil), *chain, &@block)
18
+ elsif (matching_expectation = find_matching_expectation)
19
+ chain.shift
20
+ chain_on(matching_expectation.invoke_without_incrementing_received_count(nil), *chain, &@block)
21
+ else
22
+ next_in_chain = Double.new
23
+ expectation(object, chain.shift) { next_in_chain }
24
+ chain_on(next_in_chain, *chain, &@block)
25
+ end
26
+ else
27
+ expectation(object, chain.shift, &@block)
28
+ end
29
+ end
30
+
31
+ private
32
+
33
+ def chain_on(object, *chain, &block)
34
+ initialize(object, *chain, &block)
35
+ setup_chain
36
+ end
37
+
38
+ def format_chain(*chain, &blk)
39
+ if Hash === chain.last
40
+ hash = chain.pop
41
+ hash.each do |k, v|
42
+ chain << k
43
+ blk = Proc.new { v }
44
+ end
45
+ end
46
+ return chain.join('.').split('.'), blk
47
+ end
48
+
49
+ def find_matching_stub
50
+ ::RSpec::Mocks.space.proxy_for(object).
51
+ __send__(:find_matching_method_stub, chain.first.to_sym)
52
+ end
53
+
54
+ def find_matching_expectation
55
+ ::RSpec::Mocks.space.proxy_for(object).
56
+ __send__(:find_matching_expectation, chain.first.to_sym)
57
+ end
58
+ end
59
+
60
+ # @private
61
+ class ExpectChain < MessageChain
62
+ # @api private
63
+ def self.expect_chain_on(object, *chain, &blk)
64
+ new(object, *chain, &blk).setup_chain
65
+ end
66
+
67
+ private
68
+
69
+ def expectation(object, message, &return_block)
70
+ ::RSpec::Mocks.expect_message(object, message, {}, &return_block)
71
+ end
72
+ end
73
+
74
+ # @private
75
+ class StubChain < MessageChain
76
+ def self.stub_chain_on(object, *chain, &blk)
77
+ new(object, *chain, &blk).setup_chain
78
+ end
79
+
80
+ private
81
+
82
+ def expectation(object, message, &return_block)
83
+ ::RSpec::Mocks.allow_message(object, message, {}, &return_block)
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,741 @@
1
+ module RSpec
2
+ module Mocks
3
+ # A message expectation that only allows concrete return values to be set
4
+ # for a message. While this same effect can be achieved using a standard
5
+ # MessageExpectation, this version is much faster and so can be used as an
6
+ # optimization.
7
+ #
8
+ # @private
9
+ class SimpleMessageExpectation
10
+ def initialize(message, response, error_generator, backtrace_line=nil)
11
+ @message, @response, @error_generator, @backtrace_line = message.to_sym, response, error_generator, backtrace_line
12
+ @received = false
13
+ end
14
+
15
+ def invoke(*_)
16
+ @received = true
17
+ @response
18
+ end
19
+
20
+ def matches?(message, *_)
21
+ @message == message.to_sym
22
+ end
23
+
24
+ def called_max_times?
25
+ false
26
+ end
27
+
28
+ def verify_messages_received
29
+ return if @received
30
+ @error_generator.raise_expectation_error(
31
+ @message, 1, ArgumentListMatcher::MATCH_ALL, 0, nil, [], @backtrace_line
32
+ )
33
+ end
34
+
35
+ def unadvise(_)
36
+ end
37
+ end
38
+
39
+ # Represents an individual method stub or message expectation. The methods
40
+ # defined here can be used to configure how it behaves. The methods return
41
+ # `self` so that they can be chained together to form a fluent interface.
42
+ class MessageExpectation
43
+ # @!group Configuring Responses
44
+
45
+ # @overload and_return(value)
46
+ # @overload and_return(first_value, second_value)
47
+ #
48
+ # Tells the object to return a value when it receives the message. Given
49
+ # more than one value, the first value is returned the first time the
50
+ # message is received, the second value is returned the next time, etc,
51
+ # etc.
52
+ #
53
+ # If the message is received more times than there are values, the last
54
+ # value is received for every subsequent call.
55
+ #
56
+ # @return [nil] No further chaining is supported after this.
57
+ # @example
58
+ # allow(counter).to receive(:count).and_return(1)
59
+ # counter.count # => 1
60
+ # counter.count # => 1
61
+ #
62
+ # allow(counter).to receive(:count).and_return(1,2,3)
63
+ # counter.count # => 1
64
+ # counter.count # => 2
65
+ # counter.count # => 3
66
+ # counter.count # => 3
67
+ # counter.count # => 3
68
+ # # etc
69
+ def and_return(first_value, *values)
70
+ raise_already_invoked_error_if_necessary(__method__)
71
+ if negative?
72
+ raise "`and_return` is not supported with negative message expectations"
73
+ end
74
+
75
+ if block_given?
76
+ raise ArgumentError, "Implementation blocks aren't supported with `and_return`"
77
+ end
78
+
79
+ values.unshift(first_value)
80
+ @expected_received_count = [@expected_received_count, values.size].max unless ignoring_args? || (@expected_received_count == 0 && @at_least)
81
+ self.terminal_implementation_action = AndReturnImplementation.new(values)
82
+
83
+ nil
84
+ end
85
+
86
+ # Tells the object to delegate to the original unmodified method
87
+ # when it receives the message.
88
+ #
89
+ # @note This is only available on partial doubles.
90
+ #
91
+ # @return [nil] No further chaining is supported after this.
92
+ # @example
93
+ # expect(counter).to receive(:increment).and_call_original
94
+ # original_count = counter.count
95
+ # counter.increment
96
+ # expect(counter.count).to eq(original_count + 1)
97
+ def and_call_original
98
+ wrap_original(__method__) do |original, *args, &block|
99
+ original.call(*args, &block)
100
+ end
101
+ end
102
+
103
+ # Decorates the stubbed method with the supplied block. The original
104
+ # unmodified method is passed to the block along with any method call
105
+ # arguments so you can delegate to it, whilst still being able to
106
+ # change what args are passed to it and/or change the return value.
107
+ #
108
+ # @note This is only available on partial doubles.
109
+ #
110
+ # @return [nil] No further chaining is supported after this.
111
+ # @example
112
+ # expect(api).to receive(:large_list).and_wrap_original do |original_method, *args, &block|
113
+ # original_method.call(*args, &block).first(10)
114
+ # end
115
+ def and_wrap_original(&block)
116
+ wrap_original(__method__, &block)
117
+ end
118
+
119
+ # @overload and_raise
120
+ # @overload and_raise(ExceptionClass)
121
+ # @overload and_raise(ExceptionClass, message)
122
+ # @overload and_raise(exception_instance)
123
+ #
124
+ # Tells the object to raise an exception when the message is received.
125
+ #
126
+ # @return [nil] No further chaining is supported after this.
127
+ # @note
128
+ # When you pass an exception class, the MessageExpectation will raise
129
+ # an instance of it, creating it with `exception` and passing `message`
130
+ # if specified. If the exception class initializer requires more than
131
+ # one parameters, you must pass in an instance and not the class,
132
+ # otherwise this method will raise an ArgumentError exception.
133
+ #
134
+ # @example
135
+ # allow(car).to receive(:go).and_raise
136
+ # allow(car).to receive(:go).and_raise(OutOfGas)
137
+ # allow(car).to receive(:go).and_raise(OutOfGas, "At least 2 oz of gas needed to drive")
138
+ # allow(car).to receive(:go).and_raise(OutOfGas.new(2, :oz))
139
+ def and_raise(*args)
140
+ raise_already_invoked_error_if_necessary(__method__)
141
+ self.terminal_implementation_action = Proc.new { raise(*args) }
142
+ nil
143
+ end
144
+
145
+ # @overload and_throw(symbol)
146
+ # @overload and_throw(symbol, object)
147
+ #
148
+ # Tells the object to throw a symbol (with the object if that form is
149
+ # used) when the message is received.
150
+ #
151
+ # @return [nil] No further chaining is supported after this.
152
+ # @example
153
+ # allow(car).to receive(:go).and_throw(:out_of_gas)
154
+ # allow(car).to receive(:go).and_throw(:out_of_gas, :level => 0.1)
155
+ def and_throw(*args)
156
+ raise_already_invoked_error_if_necessary(__method__)
157
+ self.terminal_implementation_action = Proc.new { throw(*args) }
158
+ nil
159
+ end
160
+
161
+ # Tells the object to yield one or more args to a block when the message
162
+ # is received.
163
+ #
164
+ # @return [MessageExpectation] self, to support further chaining.
165
+ # @example
166
+ # stream.stub(:open).and_yield(StringIO.new)
167
+ def and_yield(*args, &block)
168
+ raise_already_invoked_error_if_necessary(__method__)
169
+ yield @eval_context = Object.new if block
170
+
171
+ # Initialize args to yield now that it's being used, see also: comment
172
+ # in constructor.
173
+ @args_to_yield ||= []
174
+
175
+ @args_to_yield << args
176
+ self.initial_implementation_action = AndYieldImplementation.new(@args_to_yield, @eval_context, @error_generator)
177
+ self
178
+ end
179
+ # @!endgroup
180
+
181
+ # @!group Constraining Receive Counts
182
+
183
+ # Constrain a message expectation to be received a specific number of
184
+ # times.
185
+ #
186
+ # @return [MessageExpectation] self, to support further chaining.
187
+ # @example
188
+ # expect(dealer).to receive(:deal_card).exactly(10).times
189
+ def exactly(n, &block)
190
+ raise_already_invoked_error_if_necessary(__method__)
191
+ self.inner_implementation_action = block
192
+ set_expected_received_count :exactly, n
193
+ self
194
+ end
195
+
196
+ # Constrain a message expectation to be received at least a specific
197
+ # number of times.
198
+ #
199
+ # @return [MessageExpectation] self, to support further chaining.
200
+ # @example
201
+ # expect(dealer).to receive(:deal_card).at_least(9).times
202
+ def at_least(n, &block)
203
+ raise_already_invoked_error_if_necessary(__method__)
204
+ set_expected_received_count :at_least, n
205
+
206
+ if n == 0
207
+ raise "at_least(0) has been removed, use allow(...).to receive(:message) instead"
208
+ end
209
+
210
+ self.inner_implementation_action = block
211
+
212
+ self
213
+ end
214
+
215
+ # Constrain a message expectation to be received at most a specific
216
+ # number of times.
217
+ #
218
+ # @return [MessageExpectation] self, to support further chaining.
219
+ # @example
220
+ # expect(dealer).to receive(:deal_card).at_most(10).times
221
+ def at_most(n, &block)
222
+ raise_already_invoked_error_if_necessary(__method__)
223
+ self.inner_implementation_action = block
224
+ set_expected_received_count :at_most, n
225
+ self
226
+ end
227
+
228
+ # Syntactic sugar for `exactly`, `at_least` and `at_most`
229
+ #
230
+ # @return [MessageExpectation] self, to support further chaining.
231
+ # @example
232
+ # expect(dealer).to receive(:deal_card).exactly(10).times
233
+ # expect(dealer).to receive(:deal_card).at_least(10).times
234
+ # expect(dealer).to receive(:deal_card).at_most(10).times
235
+ def times(&block)
236
+ self.inner_implementation_action = block
237
+ self
238
+ end
239
+
240
+ # Expect a message not to be received at all.
241
+ #
242
+ # @return [MessageExpectation] self, to support further chaining.
243
+ # @example
244
+ # expect(car).to receive(:stop).never
245
+ def never
246
+ error_generator.raise_double_negation_error("expect(obj)") if negative?
247
+ @expected_received_count = 0
248
+ self
249
+ end
250
+
251
+ # Expect a message to be received exactly one time.
252
+ #
253
+ # @return [MessageExpectation] self, to support further chaining.
254
+ # @example
255
+ # expect(car).to receive(:go).once
256
+ def once(&block)
257
+ self.inner_implementation_action = block
258
+ set_expected_received_count :exactly, 1
259
+ self
260
+ end
261
+
262
+ # Expect a message to be received exactly two times.
263
+ #
264
+ # @return [MessageExpectation] self, to support further chaining.
265
+ # @example
266
+ # expect(car).to receive(:go).twice
267
+ def twice(&block)
268
+ self.inner_implementation_action = block
269
+ set_expected_received_count :exactly, 2
270
+ self
271
+ end
272
+
273
+ # Expect a message to be received exactly three times.
274
+ #
275
+ # @return [MessageExpectation] self, to support further chaining.
276
+ # @example
277
+ # expect(car).to receive(:go).thrice
278
+ def thrice(&block)
279
+ self.inner_implementation_action = block
280
+ set_expected_received_count :exactly, 3
281
+ self
282
+ end
283
+ # @!endgroup
284
+
285
+ # @!group Other Constraints
286
+
287
+ # Constrains a stub or message expectation to invocations with specific
288
+ # arguments.
289
+ #
290
+ # With a stub, if the message might be received with other args as well,
291
+ # you should stub a default value first, and then stub or mock the same
292
+ # message using `with` to constrain to specific arguments.
293
+ #
294
+ # A message expectation will fail if the message is received with different
295
+ # arguments.
296
+ #
297
+ # @return [MessageExpectation] self, to support further chaining.
298
+ # @example
299
+ # allow(cart).to receive(:add) { :failure }
300
+ # allow(cart).to receive(:add).with(Book.new(:isbn => 1934356379)) { :success }
301
+ # cart.add(Book.new(:isbn => 1234567890))
302
+ # # => :failure
303
+ # cart.add(Book.new(:isbn => 1934356379))
304
+ # # => :success
305
+ #
306
+ # expect(cart).to receive(:add).with(Book.new(:isbn => 1934356379)) { :success }
307
+ # cart.add(Book.new(:isbn => 1234567890))
308
+ # # => failed expectation
309
+ # cart.add(Book.new(:isbn => 1934356379))
310
+ # # => passes
311
+ def with(*args, &block)
312
+ raise_already_invoked_error_if_necessary(__method__)
313
+ if args.empty?
314
+ raise ArgumentError,
315
+ "`with` must have at least one argument. Use `no_args` matcher to set the expectation of receiving no arguments."
316
+ end
317
+
318
+ self.inner_implementation_action = block
319
+ @argument_list_matcher = ArgumentListMatcher.new(*args)
320
+ self
321
+ end
322
+
323
+ # Expect messages to be received in a specific order.
324
+ #
325
+ # @return [MessageExpectation] self, to support further chaining.
326
+ # @example
327
+ # expect(api).to receive(:prepare).ordered
328
+ # expect(api).to receive(:run).ordered
329
+ # expect(api).to receive(:finish).ordered
330
+ def ordered(&block)
331
+ if type == :stub
332
+ RSpec.warning(
333
+ "`allow(...).to receive(..).ordered` is not supported and will " \
334
+ "have no effect, use `and_return(*ordered_values)` instead."
335
+ )
336
+ end
337
+
338
+ self.inner_implementation_action = block
339
+ additional_expected_calls.times do
340
+ @order_group.register(self)
341
+ end
342
+ @ordered = true
343
+ self
344
+ end
345
+
346
+ # @return [String] a nice representation of the message expectation
347
+ def to_s
348
+ args_description = error_generator.method_call_args_description(@argument_list_matcher.expected_args, "", "") { true }
349
+ args_description = "(#{args_description})" unless args_description.start_with?("(")
350
+ "#<#{self.class} #{error_generator.intro}.#{message}#{args_description}>"
351
+ end
352
+ alias inspect to_s
353
+
354
+ # @private
355
+ # Contains the parts of `MessageExpectation` that aren't part of
356
+ # rspec-mocks' public API. The class is very big and could really use
357
+ # some collaborators it delegates to for this stuff but for now this was
358
+ # the simplest way to split the public from private stuff to make it
359
+ # easier to publish the docs for the APIs we want published.
360
+ module ImplementationDetails
361
+ attr_accessor :error_generator, :implementation
362
+ attr_reader :message
363
+ attr_reader :orig_object
364
+ attr_writer :expected_received_count, :expected_from, :argument_list_matcher
365
+ protected :expected_received_count=, :expected_from=, :error_generator, :error_generator=, :implementation=
366
+
367
+ # @private
368
+ attr_reader :type
369
+
370
+ # rubocop:disable Metrics/ParameterLists
371
+ def initialize(error_generator, expectation_ordering, expected_from, method_double,
372
+ type=:expectation, opts={}, &implementation_block)
373
+ @type = type
374
+ @error_generator = error_generator
375
+ @error_generator.opts = opts
376
+ @expected_from = expected_from
377
+ @method_double = method_double
378
+ @orig_object = @method_double.object
379
+ @message = @method_double.method_name
380
+ @actual_received_count = 0
381
+ @expected_received_count = type == :expectation ? 1 : :any
382
+ @argument_list_matcher = ArgumentListMatcher::MATCH_ALL
383
+ @order_group = expectation_ordering
384
+ @order_group.register(self) unless type == :stub
385
+ @expectation_type = type
386
+ @ordered = false
387
+ @at_least = @at_most = @exactly = nil
388
+
389
+ # Initialized to nil so that we don't allocate an array for every
390
+ # mock or stub. See also comment in `and_yield`.
391
+ @args_to_yield = nil
392
+ @eval_context = nil
393
+ @yield_receiver_to_implementation_block = false
394
+
395
+ @implementation = Implementation.new
396
+ self.inner_implementation_action = implementation_block
397
+ end
398
+ # rubocop:enable Metrics/ParameterLists
399
+
400
+ def expected_args
401
+ @argument_list_matcher.expected_args
402
+ end
403
+
404
+ def and_yield_receiver_to_implementation
405
+ @yield_receiver_to_implementation_block = true
406
+ self
407
+ end
408
+
409
+ def yield_receiver_to_implementation_block?
410
+ @yield_receiver_to_implementation_block
411
+ end
412
+
413
+ def matches?(message, *args)
414
+ @message == message && @argument_list_matcher.args_match?(*args)
415
+ end
416
+
417
+ def safe_invoke(parent_stub, *args, &block)
418
+ invoke_incrementing_actual_calls_by(1, false, parent_stub, *args, &block)
419
+ end
420
+
421
+ def invoke(parent_stub, *args, &block)
422
+ invoke_incrementing_actual_calls_by(1, true, parent_stub, *args, &block)
423
+ end
424
+
425
+ def invoke_without_incrementing_received_count(parent_stub, *args, &block)
426
+ invoke_incrementing_actual_calls_by(0, true, parent_stub, *args, &block)
427
+ end
428
+
429
+ def negative?
430
+ @expected_received_count == 0 && !@at_least
431
+ end
432
+
433
+ def called_max_times?
434
+ @expected_received_count != :any &&
435
+ !@at_least &&
436
+ @expected_received_count > 0 &&
437
+ @actual_received_count >= @expected_received_count
438
+ end
439
+
440
+ def matches_name_but_not_args(message, *args)
441
+ @message == message && !@argument_list_matcher.args_match?(*args)
442
+ end
443
+
444
+ def verify_messages_received
445
+ return if expected_messages_received?
446
+ generate_error
447
+ end
448
+
449
+ def expected_messages_received?
450
+ ignoring_args? || matches_exact_count? || matches_at_least_count? || matches_at_most_count?
451
+ end
452
+
453
+ def ensure_expected_ordering_received!
454
+ @order_group.verify_invocation_order(self) if @ordered
455
+ true
456
+ end
457
+
458
+ def ignoring_args?
459
+ @expected_received_count == :any
460
+ end
461
+
462
+ def matches_at_least_count?
463
+ @at_least && @actual_received_count >= @expected_received_count
464
+ end
465
+
466
+ def matches_at_most_count?
467
+ @at_most && @actual_received_count <= @expected_received_count
468
+ end
469
+
470
+ def matches_exact_count?
471
+ @expected_received_count == @actual_received_count
472
+ end
473
+
474
+ def similar_messages
475
+ @similar_messages ||= []
476
+ end
477
+
478
+ def advise(*args)
479
+ similar_messages << args
480
+ end
481
+
482
+ def unadvise(args)
483
+ similar_messages.delete_if { |message| args.include?(message) }
484
+ end
485
+
486
+ def generate_error
487
+ if similar_messages.empty?
488
+ @error_generator.raise_expectation_error(
489
+ @message, @expected_received_count, @argument_list_matcher,
490
+ @actual_received_count, expectation_count_type, expected_args,
491
+ @expected_from, exception_source_id
492
+ )
493
+ else
494
+ @error_generator.raise_similar_message_args_error(
495
+ self, @similar_messages, @expected_from
496
+ )
497
+ end
498
+ end
499
+
500
+ def raise_unexpected_message_args_error(args_for_multiple_calls)
501
+ @error_generator.raise_unexpected_message_args_error(self, args_for_multiple_calls, exception_source_id)
502
+ end
503
+
504
+ def expectation_count_type
505
+ return :at_least if @at_least
506
+ return :at_most if @at_most
507
+ nil
508
+ end
509
+
510
+ def description_for(verb)
511
+ @error_generator.describe_expectation(
512
+ verb, @message, @expected_received_count,
513
+ @actual_received_count, expected_args
514
+ )
515
+ end
516
+
517
+ def raise_out_of_order_error
518
+ @error_generator.raise_out_of_order_error @message
519
+ end
520
+
521
+ def additional_expected_calls
522
+ return 0 if @expectation_type == :stub || !@exactly
523
+ @expected_received_count - 1
524
+ end
525
+
526
+ def ordered?
527
+ @ordered
528
+ end
529
+
530
+ def negative_expectation_for?(message)
531
+ @message == message && negative?
532
+ end
533
+
534
+ def actual_received_count_matters?
535
+ @at_least || @at_most || @exactly
536
+ end
537
+
538
+ def increase_actual_received_count!
539
+ @actual_received_count += 1
540
+ end
541
+
542
+ private
543
+
544
+ def exception_source_id
545
+ @exception_source_id ||= "#{self.class.name} #{__id__}"
546
+ end
547
+
548
+ def invoke_incrementing_actual_calls_by(increment, allowed_to_fail, parent_stub, *args, &block)
549
+ args.unshift(orig_object) if yield_receiver_to_implementation_block?
550
+
551
+ if negative? || (allowed_to_fail && (@exactly || @at_most) && (@actual_received_count == @expected_received_count))
552
+ # args are the args we actually received, @argument_list_matcher is the
553
+ # list of args we were expecting
554
+ @error_generator.raise_expectation_error(
555
+ @message, @expected_received_count,
556
+ @argument_list_matcher,
557
+ @actual_received_count + increment,
558
+ expectation_count_type, args, nil, exception_source_id
559
+ )
560
+ end
561
+
562
+ @order_group.handle_order_constraint self
563
+
564
+ if implementation.present?
565
+ implementation.call(*args, &block)
566
+ elsif parent_stub
567
+ parent_stub.invoke(nil, *args, &block)
568
+ end
569
+ ensure
570
+ @actual_received_count += increment
571
+ end
572
+
573
+ def has_been_invoked?
574
+ @actual_received_count > 0
575
+ end
576
+
577
+ def raise_already_invoked_error_if_necessary(calling_customization)
578
+ return unless has_been_invoked?
579
+
580
+ error_generator.raise_already_invoked_error(message, calling_customization)
581
+ end
582
+
583
+ def set_expected_received_count(relativity, n)
584
+ raise "`count` is not supported with negative message expectations" if negative?
585
+ @at_least = (relativity == :at_least)
586
+ @at_most = (relativity == :at_most)
587
+ @exactly = (relativity == :exactly)
588
+ @expected_received_count = case n
589
+ when Numeric then n
590
+ when :once then 1
591
+ when :twice then 2
592
+ when :thrice then 3
593
+ end
594
+ end
595
+
596
+ def initial_implementation_action=(action)
597
+ implementation.initial_action = action
598
+ end
599
+
600
+ def inner_implementation_action=(action)
601
+ return unless action
602
+ warn_about_stub_override if implementation.inner_action
603
+ implementation.inner_action = action
604
+ end
605
+
606
+ def terminal_implementation_action=(action)
607
+ implementation.terminal_action = action
608
+ end
609
+
610
+ def warn_about_stub_override
611
+ RSpec.warning(
612
+ "You're overriding a previous stub implementation of `#{@message}`. " \
613
+ "Called from #{CallerFilter.first_non_rspec_line}."
614
+ )
615
+ end
616
+
617
+ def wrap_original(method_name, &block)
618
+ if RSpec::Mocks::TestDouble === @method_double.object
619
+ @error_generator.raise_only_valid_on_a_partial_double(method_name)
620
+ else
621
+ warn_about_stub_override if implementation.inner_action
622
+ @implementation = AndWrapOriginalImplementation.new(@method_double.original_implementation_callable, block)
623
+ @yield_receiver_to_implementation_block = false
624
+ end
625
+
626
+ nil
627
+ end
628
+ end
629
+
630
+ include ImplementationDetails
631
+ end
632
+
633
+ # Handles the implementation of an `and_yield` declaration.
634
+ # @private
635
+ class AndYieldImplementation
636
+ def initialize(args_to_yield, eval_context, error_generator)
637
+ @args_to_yield = args_to_yield
638
+ @eval_context = eval_context
639
+ @error_generator = error_generator
640
+ end
641
+
642
+ def call(*_args_to_ignore, &block)
643
+ return if @args_to_yield.empty? && @eval_context.nil?
644
+
645
+ @error_generator.raise_missing_block_error @args_to_yield unless block
646
+ value = nil
647
+ block_signature = Support::BlockSignature.new(block)
648
+
649
+ @args_to_yield.each do |args|
650
+ unless Support::StrictSignatureVerifier.new(block_signature, args).valid?
651
+ @error_generator.raise_wrong_arity_error(args, block_signature)
652
+ end
653
+
654
+ value = @eval_context ? @eval_context.instance_exec(*args, &block) : yield(*args)
655
+ end
656
+ value
657
+ end
658
+ end
659
+
660
+ # Handles the implementation of an `and_return` implementation.
661
+ # @private
662
+ class AndReturnImplementation
663
+ def initialize(values_to_return)
664
+ @values_to_return = values_to_return
665
+ end
666
+
667
+ def call(*_args_to_ignore, &_block)
668
+ if @values_to_return.size > 1
669
+ @values_to_return.shift
670
+ else
671
+ @values_to_return.first
672
+ end
673
+ end
674
+ end
675
+
676
+ # Represents a configured implementation. Takes into account
677
+ # any number of sub-implementations.
678
+ # @private
679
+ class Implementation
680
+ attr_accessor :initial_action, :inner_action, :terminal_action
681
+
682
+ def call(*args, &block)
683
+ actions.map do |action|
684
+ action.call(*args, &block)
685
+ end.last
686
+ end
687
+
688
+ def present?
689
+ actions.any?
690
+ end
691
+
692
+ private
693
+
694
+ def actions
695
+ [initial_action, inner_action, terminal_action].compact
696
+ end
697
+ end
698
+
699
+ # Represents an `and_call_original` implementation.
700
+ # @private
701
+ class AndWrapOriginalImplementation
702
+ def initialize(method, block)
703
+ @method = method
704
+ @block = block
705
+ end
706
+
707
+ CannotModifyFurtherError = Class.new(StandardError)
708
+
709
+ def initial_action=(_value)
710
+ raise cannot_modify_further_error
711
+ end
712
+
713
+ def inner_action=(_value)
714
+ raise cannot_modify_further_error
715
+ end
716
+
717
+ def terminal_action=(_value)
718
+ raise cannot_modify_further_error
719
+ end
720
+
721
+ def present?
722
+ true
723
+ end
724
+
725
+ def inner_action
726
+ true
727
+ end
728
+
729
+ def call(*args, &block)
730
+ @block.call(@method, *args, &block)
731
+ end
732
+
733
+ private
734
+
735
+ def cannot_modify_further_error
736
+ CannotModifyFurtherError.new "This method has already been configured " \
737
+ "to call the original implementation, and cannot be modified further."
738
+ end
739
+ end
740
+ end
741
+ end