guesswhat 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (446) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/CODE_OF_CONDUCT.md +49 -0
  4. data/Gemfile +4 -0
  5. data/README.md +36 -0
  6. data/Rakefile +4 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/guesswhat.gemspec +25 -0
  10. data/lib/guesswhat/version.rb +3 -0
  11. data/lib/guesswhat.rb +5 -0
  12. data/tasks/rspec.rake +3 -0
  13. data/vendor/bundle/bin/console +23 -0
  14. data/vendor/bundle/bin/htmldiff +25 -0
  15. data/vendor/bundle/bin/ldiff +25 -0
  16. data/vendor/bundle/bin/rake +23 -0
  17. data/vendor/bundle/bin/rspec +23 -0
  18. data/vendor/bundle/bin/setup +23 -0
  19. data/vendor/bundle/cache/diff-lcs-1.2.5.gem +0 -0
  20. data/vendor/bundle/cache/rake-10.5.0.gem +0 -0
  21. data/vendor/bundle/cache/rspec-3.4.0.gem +0 -0
  22. data/vendor/bundle/cache/rspec-core-3.4.4.gem +0 -0
  23. data/vendor/bundle/cache/rspec-expectations-3.4.0.gem +0 -0
  24. data/vendor/bundle/cache/rspec-mocks-3.4.1.gem +0 -0
  25. data/vendor/bundle/cache/rspec-support-3.4.1.gem +0 -0
  26. data/vendor/bundle/gems/diff-lcs-1.2.5/.autotest +3 -0
  27. data/vendor/bundle/gems/diff-lcs-1.2.5/.gemtest +0 -0
  28. data/vendor/bundle/gems/diff-lcs-1.2.5/.hoerc +2 -0
  29. data/vendor/bundle/gems/diff-lcs-1.2.5/.rspec +2 -0
  30. data/vendor/bundle/gems/diff-lcs-1.2.5/.travis.yml +22 -0
  31. data/vendor/bundle/gems/diff-lcs-1.2.5/Contributing.rdoc +64 -0
  32. data/vendor/bundle/gems/diff-lcs-1.2.5/Gemfile +20 -0
  33. data/vendor/bundle/gems/diff-lcs-1.2.5/History.rdoc +152 -0
  34. data/vendor/bundle/gems/diff-lcs-1.2.5/License.rdoc +39 -0
  35. data/vendor/bundle/gems/diff-lcs-1.2.5/Manifest.txt +38 -0
  36. data/vendor/bundle/gems/diff-lcs-1.2.5/README.rdoc +85 -0
  37. data/vendor/bundle/gems/diff-lcs-1.2.5/Rakefile +41 -0
  38. data/vendor/bundle/gems/diff-lcs-1.2.5/autotest/discover.rb +1 -0
  39. data/vendor/bundle/gems/diff-lcs-1.2.5/bin/htmldiff +32 -0
  40. data/vendor/bundle/gems/diff-lcs-1.2.5/bin/ldiff +6 -0
  41. data/vendor/bundle/gems/diff-lcs-1.2.5/docs/COPYING.txt +339 -0
  42. data/vendor/bundle/gems/diff-lcs-1.2.5/docs/artistic.txt +127 -0
  43. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/array.rb +7 -0
  44. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/block.rb +37 -0
  45. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/callbacks.rb +322 -0
  46. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/change.rb +177 -0
  47. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/htmldiff.rb +149 -0
  48. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/hunk.rb +276 -0
  49. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/internals.rb +301 -0
  50. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/ldiff.rb +195 -0
  51. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs/string.rb +5 -0
  52. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff/lcs.rb +805 -0
  53. data/vendor/bundle/gems/diff-lcs-1.2.5/lib/diff-lcs.rb +3 -0
  54. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/change_spec.rb +65 -0
  55. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/diff_spec.rb +47 -0
  56. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/hunk_spec.rb +72 -0
  57. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/issues_spec.rb +24 -0
  58. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/lcs_spec.rb +54 -0
  59. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/patch_spec.rb +414 -0
  60. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/sdiff_spec.rb +214 -0
  61. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/spec_helper.rb +290 -0
  62. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/traverse_balanced_spec.rb +310 -0
  63. data/vendor/bundle/gems/diff-lcs-1.2.5/spec/traverse_sequences_spec.rb +139 -0
  64. data/vendor/bundle/gems/rake-10.5.0/.autotest +7 -0
  65. data/vendor/bundle/gems/rake-10.5.0/.rubocop.yml +27 -0
  66. data/vendor/bundle/gems/rake-10.5.0/.togglerc +7 -0
  67. data/vendor/bundle/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
  68. data/vendor/bundle/gems/rake-10.5.0/History.rdoc +659 -0
  69. data/vendor/bundle/gems/rake-10.5.0/MIT-LICENSE +21 -0
  70. data/vendor/bundle/gems/rake-10.5.0/Manifest.txt +166 -0
  71. data/vendor/bundle/gems/rake-10.5.0/README.rdoc +139 -0
  72. data/vendor/bundle/gems/rake-10.5.0/Rakefile +81 -0
  73. data/vendor/bundle/gems/rake-10.5.0/bin/rake +33 -0
  74. data/vendor/bundle/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
  75. data/vendor/bundle/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
  76. data/vendor/bundle/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
  77. data/vendor/bundle/gems/rake-10.5.0/doc/example/a.c +6 -0
  78. data/vendor/bundle/gems/rake-10.5.0/doc/example/b.c +6 -0
  79. data/vendor/bundle/gems/rake-10.5.0/doc/example/main.c +11 -0
  80. data/vendor/bundle/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
  81. data/vendor/bundle/gems/rake-10.5.0/doc/jamis.rb +591 -0
  82. data/vendor/bundle/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
  83. data/vendor/bundle/gems/rake-10.5.0/doc/rake.1 +141 -0
  84. data/vendor/bundle/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
  85. data/vendor/bundle/gems/rake-10.5.0/doc/rational.rdoc +151 -0
  86. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
  87. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
  88. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
  89. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
  90. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
  91. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
  92. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
  93. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
  94. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
  95. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
  96. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
  97. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
  98. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
  99. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
  100. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
  101. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
  102. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
  103. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
  104. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
  105. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
  106. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
  107. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
  108. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
  109. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
  110. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
  111. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
  112. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
  113. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
  114. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
  115. data/vendor/bundle/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
  116. data/vendor/bundle/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
  117. data/vendor/bundle/gems/rake-10.5.0/lib/rake/application.rb +790 -0
  118. data/vendor/bundle/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
  119. data/vendor/bundle/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
  120. data/vendor/bundle/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
  121. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
  122. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
  123. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
  124. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
  125. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
  126. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
  127. data/vendor/bundle/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
  128. data/vendor/bundle/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
  129. data/vendor/bundle/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
  130. data/vendor/bundle/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
  131. data/vendor/bundle/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
  132. data/vendor/bundle/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
  133. data/vendor/bundle/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
  134. data/vendor/bundle/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
  135. data/vendor/bundle/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
  136. data/vendor/bundle/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
  137. data/vendor/bundle/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
  138. data/vendor/bundle/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
  139. data/vendor/bundle/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
  140. data/vendor/bundle/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
  141. data/vendor/bundle/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
  142. data/vendor/bundle/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
  143. data/vendor/bundle/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
  144. data/vendor/bundle/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
  145. data/vendor/bundle/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
  146. data/vendor/bundle/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
  147. data/vendor/bundle/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
  148. data/vendor/bundle/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
  149. data/vendor/bundle/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
  150. data/vendor/bundle/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
  151. data/vendor/bundle/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
  152. data/vendor/bundle/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
  153. data/vendor/bundle/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
  154. data/vendor/bundle/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
  155. data/vendor/bundle/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
  156. data/vendor/bundle/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
  157. data/vendor/bundle/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
  158. data/vendor/bundle/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
  159. data/vendor/bundle/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
  160. data/vendor/bundle/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
  161. data/vendor/bundle/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
  162. data/vendor/bundle/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
  163. data/vendor/bundle/gems/rake-10.5.0/lib/rake/task.rb +383 -0
  164. data/vendor/bundle/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
  165. data/vendor/bundle/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
  166. data/vendor/bundle/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
  167. data/vendor/bundle/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
  168. data/vendor/bundle/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
  169. data/vendor/bundle/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
  170. data/vendor/bundle/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
  171. data/vendor/bundle/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
  172. data/vendor/bundle/gems/rake-10.5.0/lib/rake/version.rb +7 -0
  173. data/vendor/bundle/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
  174. data/vendor/bundle/gems/rake-10.5.0/lib/rake.rb +79 -0
  175. data/vendor/bundle/gems/rake-10.5.0/rakelib/publish.rake +20 -0
  176. data/vendor/bundle/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
  177. data/vendor/bundle/gems/rake-10.5.0/test/file_creation.rb +34 -0
  178. data/vendor/bundle/gems/rake-10.5.0/test/helper.rb +129 -0
  179. data/vendor/bundle/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
  180. data/vendor/bundle/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
  181. data/vendor/bundle/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
  182. data/vendor/bundle/gems/rake-10.5.0/test/test_rake.rb +40 -0
  183. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
  184. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
  185. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
  186. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
  187. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
  188. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
  189. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
  190. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
  191. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
  192. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
  193. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
  194. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
  195. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
  196. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
  197. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
  198. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
  199. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
  200. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
  201. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
  202. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
  203. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
  204. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
  205. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
  206. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
  207. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
  208. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
  209. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
  210. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
  211. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
  212. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
  213. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
  214. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
  215. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
  216. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
  217. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
  218. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
  219. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
  220. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
  221. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
  222. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
  223. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
  224. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
  225. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
  226. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
  227. data/vendor/bundle/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
  228. data/vendor/bundle/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
  229. data/vendor/bundle/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
  230. data/vendor/bundle/gems/rspec-3.4.0/LICENSE.md +27 -0
  231. data/vendor/bundle/gems/rspec-3.4.0/README.md +39 -0
  232. data/vendor/bundle/gems/rspec-3.4.0/lib/rspec/version.rb +5 -0
  233. data/vendor/bundle/gems/rspec-3.4.0/lib/rspec.rb +3 -0
  234. data/vendor/bundle/gems/rspec-core-3.4.4/.document +5 -0
  235. data/vendor/bundle/gems/rspec-core-3.4.4/.yardopts +8 -0
  236. data/vendor/bundle/gems/rspec-core-3.4.4/Changelog.md +1972 -0
  237. data/vendor/bundle/gems/rspec-core-3.4.4/LICENSE.md +26 -0
  238. data/vendor/bundle/gems/rspec-core-3.4.4/README.md +384 -0
  239. data/vendor/bundle/gems/rspec-core-3.4.4/exe/rspec +4 -0
  240. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/autorun.rb +3 -0
  241. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/backtrace_formatter.rb +65 -0
  242. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/bisect/coordinator.rb +66 -0
  243. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/bisect/example_minimizer.rb +169 -0
  244. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/bisect/runner.rb +139 -0
  245. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/bisect/server.rb +61 -0
  246. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb +1869 -0
  247. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/configuration_options.rb +191 -0
  248. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/drb.rb +111 -0
  249. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/dsl.rb +96 -0
  250. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/example.rb +631 -0
  251. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb +816 -0
  252. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/example_status_persister.rb +235 -0
  253. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/filter_manager.rb +231 -0
  254. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/flat_map.rb +20 -0
  255. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/base_formatter.rb +70 -0
  256. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/base_text_formatter.rb +77 -0
  257. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/bisect_formatter.rb +68 -0
  258. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/bisect_progress_formatter.rb +144 -0
  259. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/console_codes.rb +65 -0
  260. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
  261. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/documentation_formatter.rb +70 -0
  262. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/exception_presenter.rb +482 -0
  263. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
  264. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/helpers.rb +109 -0
  265. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/html_formatter.rb +151 -0
  266. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/html_printer.rb +414 -0
  267. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/html_snippet_extractor.rb +116 -0
  268. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/json_formatter.rb +96 -0
  269. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/profile_formatter.rb +68 -0
  270. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/progress_formatter.rb +28 -0
  271. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/protocol.rb +181 -0
  272. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters/snippet_extractor.rb +136 -0
  273. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/formatters.rb +255 -0
  274. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/hooks.rb +638 -0
  275. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/memoized_helpers.rb +532 -0
  276. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/metadata.rb +498 -0
  277. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/metadata_filter.rb +231 -0
  278. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
  279. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
  280. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
  281. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/mocking_adapters/null.rb +14 -0
  282. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/mocking_adapters/rr.rb +31 -0
  283. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
  284. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/notifications.rb +499 -0
  285. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/option_parser.rb +319 -0
  286. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/ordering.rb +158 -0
  287. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/pending.rb +165 -0
  288. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/profiler.rb +32 -0
  289. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/project_initializer/.rspec +2 -0
  290. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/project_initializer/spec/spec_helper.rb +96 -0
  291. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/project_initializer.rb +48 -0
  292. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/rake_task.rb +167 -0
  293. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb +236 -0
  294. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/ruby_project.rb +53 -0
  295. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb +183 -0
  296. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/sandbox.rb +37 -0
  297. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/set.rb +49 -0
  298. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/shared_context.rb +55 -0
  299. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/shared_example_group.rb +212 -0
  300. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/shell_escape.rb +49 -0
  301. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/source/location.rb +13 -0
  302. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/source/node.rb +93 -0
  303. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/source/syntax_highlighter.rb +71 -0
  304. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/source/token.rb +86 -0
  305. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/source.rb +76 -0
  306. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
  307. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/version.rb +9 -0
  308. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/warnings.rb +40 -0
  309. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/world.rb +213 -0
  310. data/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core.rb +181 -0
  311. data/vendor/bundle/gems/rspec-expectations-3.4.0/.document +5 -0
  312. data/vendor/bundle/gems/rspec-expectations-3.4.0/.yardopts +6 -0
  313. data/vendor/bundle/gems/rspec-expectations-3.4.0/Changelog.md +979 -0
  314. data/vendor/bundle/gems/rspec-expectations-3.4.0/LICENSE.md +25 -0
  315. data/vendor/bundle/gems/rspec-expectations-3.4.0/README.md +303 -0
  316. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/configuration.rb +164 -0
  317. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/expectation_target.rb +113 -0
  318. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/fail_with.rb +31 -0
  319. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/failure_aggregator.rb +194 -0
  320. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/handler.rb +170 -0
  321. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/minitest_integration.rb +31 -0
  322. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/syntax.rb +132 -0
  323. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations/version.rb +8 -0
  324. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/expectations.rb +81 -0
  325. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/aliased_matcher.rb +116 -0
  326. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/all.rb +85 -0
  327. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/base_matcher.rb +181 -0
  328. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/be.rb +285 -0
  329. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/be_between.rb +77 -0
  330. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/be_instance_of.rb +22 -0
  331. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/be_kind_of.rb +16 -0
  332. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/be_within.rb +72 -0
  333. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/change.rb +354 -0
  334. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/compound.rb +272 -0
  335. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/contain_exactly.rb +286 -0
  336. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/cover.rb +24 -0
  337. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/eq.rb +40 -0
  338. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/eql.rb +34 -0
  339. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/equal.rb +81 -0
  340. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/exist.rb +86 -0
  341. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/has.rb +103 -0
  342. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
  343. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/include.rb +130 -0
  344. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/match.rb +106 -0
  345. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/operators.rb +128 -0
  346. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/output.rb +200 -0
  347. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/raise_error.rb +228 -0
  348. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/respond_to.rb +90 -0
  349. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/satisfy.rb +37 -0
  350. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
  351. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
  352. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in/yield.rb +419 -0
  353. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/built_in.rb +52 -0
  354. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/composable.rb +185 -0
  355. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/dsl.rb +453 -0
  356. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/english_phrasing.rb +42 -0
  357. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +73 -0
  358. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/fail_matchers.rb +42 -0
  359. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/generated_descriptions.rb +42 -0
  360. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/matcher_delegator.rb +35 -0
  361. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers/matcher_protocol.rb +99 -0
  362. data/vendor/bundle/gems/rspec-expectations-3.4.0/lib/rspec/matchers.rb +1037 -0
  363. data/vendor/bundle/gems/rspec-mocks-3.4.1/.document +5 -0
  364. data/vendor/bundle/gems/rspec-mocks-3.4.1/.yardopts +6 -0
  365. data/vendor/bundle/gems/rspec-mocks-3.4.1/Changelog.md +991 -0
  366. data/vendor/bundle/gems/rspec-mocks-3.4.1/LICENSE.md +25 -0
  367. data/vendor/bundle/gems/rspec-mocks-3.4.1/README.md +445 -0
  368. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/chain.rb +110 -0
  369. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
  370. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/expect_chain_chain.rb +35 -0
  371. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/expectation_chain.rb +48 -0
  372. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
  373. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/proxy.rb +116 -0
  374. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/recorder.rb +268 -0
  375. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/stub_chain.rb +46 -0
  376. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance/stub_chain_chain.rb +27 -0
  377. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/any_instance.rb +11 -0
  378. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/argument_list_matcher.rb +100 -0
  379. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/argument_matchers.rb +320 -0
  380. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/configuration.rb +205 -0
  381. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/error_generator.rb +367 -0
  382. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/example_methods.rb +422 -0
  383. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/instance_method_stasher.rb +135 -0
  384. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/marshal_extension.rb +41 -0
  385. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
  386. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/matchers/have_received.rb +128 -0
  387. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/matchers/receive.rb +130 -0
  388. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/matchers/receive_message_chain.rb +80 -0
  389. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/matchers/receive_messages.rb +75 -0
  390. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/message_chain.rb +87 -0
  391. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/message_expectation.rb +717 -0
  392. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/method_double.rb +287 -0
  393. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/method_reference.rb +192 -0
  394. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/mutate_const.rb +335 -0
  395. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/object_reference.rb +149 -0
  396. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/order_group.rb +81 -0
  397. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/proxy.rb +484 -0
  398. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/space.rb +238 -0
  399. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/standalone.rb +3 -0
  400. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/syntax.rb +325 -0
  401. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/targets.rb +97 -0
  402. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/test_double.rb +170 -0
  403. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/verifying_double.rb +129 -0
  404. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/verifying_message_expectation.rb +54 -0
  405. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/verifying_proxy.rb +213 -0
  406. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks/version.rb +9 -0
  407. data/vendor/bundle/gems/rspec-mocks-3.4.1/lib/rspec/mocks.rb +126 -0
  408. data/vendor/bundle/gems/rspec-support-3.4.1/Changelog.md +151 -0
  409. data/vendor/bundle/gems/rspec-support-3.4.1/LICENSE.md +23 -0
  410. data/vendor/bundle/gems/rspec-support-3.4.1/README.md +40 -0
  411. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/caller_filter.rb +83 -0
  412. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/comparable_version.rb +46 -0
  413. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/differ.rb +215 -0
  414. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/directory_maker.rb +63 -0
  415. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/encoded_string.rb +155 -0
  416. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/fuzzy_matcher.rb +48 -0
  417. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/hunk_generator.rb +47 -0
  418. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/matcher_definition.rb +42 -0
  419. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/method_signature_verifier.rb +290 -0
  420. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/mutex.rb +73 -0
  421. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/object_formatter.rb +108 -0
  422. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/recursive_const_methods.rb +76 -0
  423. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/reentrant_mutex.rb +53 -0
  424. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/ruby_features.rb +149 -0
  425. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
  426. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/formatting_support.rb +9 -0
  427. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/in_sub_process.rb +52 -0
  428. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/library_wide_checks.rb +152 -0
  429. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/shell_out.rb +71 -0
  430. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/stderr_splitter.rb +63 -0
  431. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/string_matcher.rb +46 -0
  432. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/with_isolated_directory.rb +9 -0
  433. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
  434. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/spec.rb +81 -0
  435. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/version.rb +7 -0
  436. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/version_checker.rb +53 -0
  437. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support/warnings.rb +39 -0
  438. data/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support.rb +139 -0
  439. data/vendor/bundle/specifications/diff-lcs-1.2.5.gemspec +68 -0
  440. data/vendor/bundle/specifications/rake-10.5.0.gemspec +43 -0
  441. data/vendor/bundle/specifications/rspec-3.4.0.gemspec +42 -0
  442. data/vendor/bundle/specifications/rspec-core-3.4.4.gemspec +65 -0
  443. data/vendor/bundle/specifications/rspec-expectations-3.4.0.gemspec +50 -0
  444. data/vendor/bundle/specifications/rspec-mocks-3.4.1.gemspec +50 -0
  445. data/vendor/bundle/specifications/rspec-support-3.4.1.gemspec +41 -0
  446. metadata +532 -0
@@ -0,0 +1,1037 @@
1
+ require 'rspec/support'
2
+ RSpec::Support.require_rspec_support 'matcher_definition'
3
+ RSpec::Support.define_optimized_require_for_rspec(:matchers) { |f| require_relative(f) }
4
+
5
+ %w[
6
+ english_phrasing
7
+ composable
8
+ built_in
9
+ generated_descriptions
10
+ dsl
11
+ matcher_delegator
12
+ aliased_matcher
13
+ expecteds_for_multiple_diffs
14
+ ].each { |file| RSpec::Support.require_rspec_matchers(file) }
15
+
16
+ # RSpec's top level namespace. All of rspec-expectations is contained
17
+ # in the `RSpec::Expectations` and `RSpec::Matchers` namespaces.
18
+ module RSpec
19
+ # RSpec::Matchers provides a number of useful matchers we use to define
20
+ # expectations. Any object that implements the [matcher protocol](Matchers/MatcherProtocol)
21
+ # can be used as a matcher.
22
+ #
23
+ # ## Predicates
24
+ #
25
+ # In addition to matchers that are defined explicitly, RSpec will create
26
+ # custom matchers on the fly for any arbitrary predicate, giving your specs a
27
+ # much more natural language feel.
28
+ #
29
+ # A Ruby predicate is a method that ends with a "?" and returns true or false.
30
+ # Common examples are `empty?`, `nil?`, and `instance_of?`.
31
+ #
32
+ # All you need to do is write `expect(..).to be_` followed by the predicate
33
+ # without the question mark, and RSpec will figure it out from there.
34
+ # For example:
35
+ #
36
+ # expect([]).to be_empty # => [].empty?() | passes
37
+ # expect([]).not_to be_empty # => [].empty?() | fails
38
+ #
39
+ # In addtion to prefixing the predicate matchers with "be_", you can also use "be_a_"
40
+ # and "be_an_", making your specs read much more naturally:
41
+ #
42
+ # expect("a string").to be_an_instance_of(String) # =>"a string".instance_of?(String) # passes
43
+ #
44
+ # expect(3).to be_a_kind_of(Fixnum) # => 3.kind_of?(Numeric) | passes
45
+ # expect(3).to be_a_kind_of(Numeric) # => 3.kind_of?(Numeric) | passes
46
+ # expect(3).to be_an_instance_of(Fixnum) # => 3.instance_of?(Fixnum) | passes
47
+ # expect(3).not_to be_an_instance_of(Numeric) # => 3.instance_of?(Numeric) | fails
48
+ #
49
+ # RSpec will also create custom matchers for predicates like `has_key?`. To
50
+ # use this feature, just state that the object should have_key(:key) and RSpec will
51
+ # call has_key?(:key) on the target. For example:
52
+ #
53
+ # expect(:a => "A").to have_key(:a)
54
+ # expect(:a => "A").to have_key(:b) # fails
55
+ #
56
+ # You can use this feature to invoke any predicate that begins with "has_", whether it is
57
+ # part of the Ruby libraries (like `Hash#has_key?`) or a method you wrote on your own class.
58
+ #
59
+ # Note that RSpec does not provide composable aliases for these dynamic predicate
60
+ # matchers. You can easily define your own aliases, though:
61
+ #
62
+ # RSpec::Matchers.alias_matcher :a_user_who_is_an_admin, :be_an_admin
63
+ # expect(user_list).to include(a_user_who_is_an_admin)
64
+ #
65
+ # ## Custom Matchers
66
+ #
67
+ # When you find that none of the stock matchers provide a natural feeling
68
+ # expectation, you can very easily write your own using RSpec's matcher DSL
69
+ # or writing one from scratch.
70
+ #
71
+ # ### Matcher DSL
72
+ #
73
+ # Imagine that you are writing a game in which players can be in various
74
+ # zones on a virtual board. To specify that bob should be in zone 4, you
75
+ # could say:
76
+ #
77
+ # expect(bob.current_zone).to eql(Zone.new("4"))
78
+ #
79
+ # But you might find it more expressive to say:
80
+ #
81
+ # expect(bob).to be_in_zone("4")
82
+ #
83
+ # and/or
84
+ #
85
+ # expect(bob).not_to be_in_zone("3")
86
+ #
87
+ # You can create such a matcher like so:
88
+ #
89
+ # RSpec::Matchers.define :be_in_zone do |zone|
90
+ # match do |player|
91
+ # player.in_zone?(zone)
92
+ # end
93
+ # end
94
+ #
95
+ # This will generate a <tt>be_in_zone</tt> method that returns a matcher
96
+ # with logical default messages for failures. You can override the failure
97
+ # messages and the generated description as follows:
98
+ #
99
+ # RSpec::Matchers.define :be_in_zone do |zone|
100
+ # match do |player|
101
+ # player.in_zone?(zone)
102
+ # end
103
+ #
104
+ # failure_message do |player|
105
+ # # generate and return the appropriate string.
106
+ # end
107
+ #
108
+ # failure_message_when_negated do |player|
109
+ # # generate and return the appropriate string.
110
+ # end
111
+ #
112
+ # description do
113
+ # # generate and return the appropriate string.
114
+ # end
115
+ # end
116
+ #
117
+ # Each of the message-generation methods has access to the block arguments
118
+ # passed to the <tt>create</tt> method (in this case, <tt>zone</tt>). The
119
+ # failure message methods (<tt>failure_message</tt> and
120
+ # <tt>failure_message_when_negated</tt>) are passed the actual value (the
121
+ # receiver of <tt>expect(..)</tt> or <tt>expect(..).not_to</tt>).
122
+ #
123
+ # ### Custom Matcher from scratch
124
+ #
125
+ # You could also write a custom matcher from scratch, as follows:
126
+ #
127
+ # class BeInZone
128
+ # def initialize(expected)
129
+ # @expected = expected
130
+ # end
131
+ #
132
+ # def matches?(target)
133
+ # @target = target
134
+ # @target.current_zone.eql?(Zone.new(@expected))
135
+ # end
136
+ #
137
+ # def failure_message
138
+ # "expected #{@target.inspect} to be in Zone #{@expected}"
139
+ # end
140
+ #
141
+ # def failure_message_when_negated
142
+ # "expected #{@target.inspect} not to be in Zone #{@expected}"
143
+ # end
144
+ # end
145
+ #
146
+ # ... and a method like this:
147
+ #
148
+ # def be_in_zone(expected)
149
+ # BeInZone.new(expected)
150
+ # end
151
+ #
152
+ # And then expose the method to your specs. This is normally done
153
+ # by including the method and the class in a module, which is then
154
+ # included in your spec:
155
+ #
156
+ # module CustomGameMatchers
157
+ # class BeInZone
158
+ # # ...
159
+ # end
160
+ #
161
+ # def be_in_zone(expected)
162
+ # # ...
163
+ # end
164
+ # end
165
+ #
166
+ # describe "Player behaviour" do
167
+ # include CustomGameMatchers
168
+ # # ...
169
+ # end
170
+ #
171
+ # or you can include in globally in a spec_helper.rb file <tt>require</tt>d
172
+ # from your spec file(s):
173
+ #
174
+ # RSpec::configure do |config|
175
+ # config.include(CustomGameMatchers)
176
+ # end
177
+ #
178
+ # ### Making custom matchers composable
179
+ #
180
+ # RSpec's built-in matchers are designed to be composed, in expressions like:
181
+ #
182
+ # expect(["barn", 2.45]).to contain_exactly(
183
+ # a_value_within(0.1).of(2.5),
184
+ # a_string_starting_with("bar")
185
+ # )
186
+ #
187
+ # Custom matchers can easily participate in composed matcher expressions like these.
188
+ # Include {RSpec::Matchers::Composable} in your custom matcher to make it support
189
+ # being composed (matchers defined using the DSL have this included automatically).
190
+ # Within your matcher's `matches?` method (or the `match` block, if using the DSL),
191
+ # use `values_match?(expected, actual)` rather than `expected == actual`.
192
+ # Under the covers, `values_match?` is able to match arbitrary
193
+ # nested data structures containing a mix of both matchers and non-matcher objects.
194
+ # It uses `===` and `==` to perform the matching, considering the values to
195
+ # match if either returns `true`. The `Composable` mixin also provides some helper
196
+ # methods for surfacing the matcher descriptions within your matcher's description
197
+ # or failure messages.
198
+ #
199
+ # RSpec's built-in matchers each have a number of aliases that rephrase the matcher
200
+ # from a verb phrase (such as `be_within`) to a noun phrase (such as `a_value_within`),
201
+ # which reads better when the matcher is passed as an argument in a composed matcher
202
+ # expressions, and also uses the noun-phrase wording in the matcher's `description`,
203
+ # for readable failure messages. You can alias your custom matchers in similar fashion
204
+ # using {RSpec::Matchers.alias_matcher}.
205
+ module Matchers
206
+ # @method expect
207
+ # Supports `expect(actual).to matcher` syntax by wrapping `actual` in an
208
+ # `ExpectationTarget`.
209
+ # @example
210
+ # expect(actual).to eq(expected)
211
+ # expect(actual).not_to eq(expected)
212
+ # @return [ExpectationTarget]
213
+ # @see ExpectationTarget#to
214
+ # @see ExpectationTarget#not_to
215
+
216
+ # Defines a matcher alias. The returned matcher's `description` will be overriden
217
+ # to reflect the phrasing of the new name, which will be used in failure messages
218
+ # when passed as an argument to another matcher in a composed matcher expression.
219
+ #
220
+ # @param new_name [Symbol] the new name for the matcher
221
+ # @param old_name [Symbol] the original name for the matcher
222
+ # @param options [Hash] options for the aliased matcher
223
+ # @option options [Class] :klass the ruby class to use as the decorator. (Not normally used).
224
+ # @yield [String] optional block that, when given, is used to define the overriden
225
+ # logic. The yielded arg is the original description or failure message. If no
226
+ # block is provided, a default override is used based on the old and new names.
227
+ #
228
+ # @example
229
+ # RSpec::Matchers.alias_matcher :a_list_that_sums_to, :sum_to
230
+ # sum_to(3).description # => "sum to 3"
231
+ # a_list_that_sums_to(3).description # => "a list that sums to 3"
232
+ #
233
+ # @example
234
+ # RSpec::Matchers.alias_matcher :a_list_sorted_by, :be_sorted_by do |description|
235
+ # description.sub("be sorted by", "a list sorted by")
236
+ # end
237
+ #
238
+ # be_sorted_by(:age).description # => "be sorted by age"
239
+ # a_list_sorted_by(:age).description # => "a list sorted by age"
240
+ #
241
+ # @!macro [attach] alias_matcher
242
+ # @!parse
243
+ # alias $1 $2
244
+ def self.alias_matcher(new_name, old_name, options={}, &description_override)
245
+ description_override ||= lambda do |old_desc|
246
+ old_desc.gsub(EnglishPhrasing.split_words(old_name), EnglishPhrasing.split_words(new_name))
247
+ end
248
+ klass = options.fetch(:klass) { AliasedMatcher }
249
+
250
+ define_method(new_name) do |*args, &block|
251
+ matcher = __send__(old_name, *args, &block)
252
+ klass.new(matcher, description_override)
253
+ end
254
+ end
255
+
256
+ # Defines a negated matcher. The returned matcher's `description` and `failure_message`
257
+ # will be overriden to reflect the phrasing of the new name, and the match logic will
258
+ # be based on the original matcher but negated.
259
+ #
260
+ # @param negated_name [Symbol] the name for the negated matcher
261
+ # @param base_name [Symbol] the name of the original matcher that will be negated
262
+ # @yield [String] optional block that, when given, is used to define the overriden
263
+ # logic. The yielded arg is the original description or failure message. If no
264
+ # block is provided, a default override is used based on the old and new names.
265
+ #
266
+ # @example
267
+ # RSpec::Matchers.define_negated_matcher :exclude, :include
268
+ # include(1, 2).description # => "include 1 and 2"
269
+ # exclude(1, 2).description # => "exclude 1 and 2"
270
+ #
271
+ # @note While the most obvious negated form may be to add a `not_` prefix,
272
+ # the failure messages you get with that form can be confusing (e.g.
273
+ # "expected [actual] to not [verb], but did not"). We've found it works
274
+ # best to find a more positive name for the negated form, such as
275
+ # `avoid_changing` rather than `not_change`.
276
+ def self.define_negated_matcher(negated_name, base_name, &description_override)
277
+ alias_matcher(negated_name, base_name, :klass => AliasedNegatedMatcher, &description_override)
278
+ end
279
+
280
+ # Allows multiple expectations in the provided block to fail, and then
281
+ # aggregates them into a single exception, rather than aborting on the
282
+ # first expectation failure like normal. This allows you to see all
283
+ # failures from an entire set of expectations without splitting each
284
+ # off into its own example (which may slow things down if the example
285
+ # setup is expensive).
286
+ #
287
+ # @param label [String] label for this aggregation block, which will be
288
+ # included in the aggregated exception message.
289
+ # @param metadata [Hash] additional metadata about this failure aggregation
290
+ # block. If multiple expectations fail, it will be exposed from the
291
+ # {Expectations::MultipleExpectationsNotMetError} exception. Mostly
292
+ # intended for internal RSpec use but you can use it as well.
293
+ # @yield Block containing as many expectation as you want. The block is
294
+ # simply yielded to, so you can trust that anything that works outside
295
+ # the block should work within it.
296
+ # @raise [Expectations::MultipleExpectationsNotMetError] raised when
297
+ # multiple expectations fail.
298
+ # @raise [Expectations::ExpectationNotMetError] raised when a single
299
+ # expectation fails.
300
+ # @raise [Exception] other sorts of exceptions will be raised as normal.
301
+ #
302
+ # @example
303
+ # aggregate_failures("verifying response") do
304
+ # expect(response.status).to eq(200)
305
+ # expect(response.headers).to include("Content-Type" => "text/plain")
306
+ # expect(response.body).to include("Success")
307
+ # end
308
+ #
309
+ # @note The implementation of this feature uses a thread-local variable,
310
+ # which means that if you have an expectation failure in another thread,
311
+ # it'll abort like normal.
312
+ def aggregate_failures(label=nil, metadata={}, &block)
313
+ Expectations::FailureAggregator.new(label, metadata).aggregate(&block)
314
+ end
315
+
316
+ # Passes if actual is truthy (anything but false or nil)
317
+ def be_truthy
318
+ BuiltIn::BeTruthy.new
319
+ end
320
+ alias_matcher :a_truthy_value, :be_truthy
321
+
322
+ # Passes if actual is falsey (false or nil)
323
+ def be_falsey
324
+ BuiltIn::BeFalsey.new
325
+ end
326
+ alias_matcher :be_falsy, :be_falsey
327
+ alias_matcher :a_falsey_value, :be_falsey
328
+ alias_matcher :a_falsy_value, :be_falsey
329
+
330
+ # Passes if actual is nil
331
+ def be_nil
332
+ BuiltIn::BeNil.new
333
+ end
334
+ alias_matcher :a_nil_value, :be_nil
335
+
336
+ # @example
337
+ # expect(actual).to be_truthy
338
+ # expect(actual).to be_falsey
339
+ # expect(actual).to be_nil
340
+ # expect(actual).to be_[arbitrary_predicate](*args)
341
+ # expect(actual).not_to be_nil
342
+ # expect(actual).not_to be_[arbitrary_predicate](*args)
343
+ #
344
+ # Given true, false, or nil, will pass if actual value is true, false or
345
+ # nil (respectively). Given no args means the caller should satisfy an if
346
+ # condition (to be or not to be).
347
+ #
348
+ # Predicates are any Ruby method that ends in a "?" and returns true or
349
+ # false. Given be_ followed by arbitrary_predicate (without the "?"),
350
+ # RSpec will match convert that into a query against the target object.
351
+ #
352
+ # The arbitrary_predicate feature will handle any predicate prefixed with
353
+ # "be_an_" (e.g. be_an_instance_of), "be_a_" (e.g. be_a_kind_of) or "be_"
354
+ # (e.g. be_empty), letting you choose the prefix that best suits the
355
+ # predicate.
356
+ def be(*args)
357
+ args.empty? ? Matchers::BuiltIn::Be.new : equal(*args)
358
+ end
359
+ alias_matcher :a_value, :be, :klass => AliasedMatcherWithOperatorSupport
360
+
361
+ # passes if target.kind_of?(klass)
362
+ def be_a(klass)
363
+ be_a_kind_of(klass)
364
+ end
365
+ alias_method :be_an, :be_a
366
+
367
+ # Passes if actual.instance_of?(expected)
368
+ #
369
+ # @example
370
+ # expect(5).to be_an_instance_of(Fixnum)
371
+ # expect(5).not_to be_an_instance_of(Numeric)
372
+ # expect(5).not_to be_an_instance_of(Float)
373
+ def be_an_instance_of(expected)
374
+ BuiltIn::BeAnInstanceOf.new(expected)
375
+ end
376
+ alias_method :be_instance_of, :be_an_instance_of
377
+ alias_matcher :an_instance_of, :be_an_instance_of
378
+
379
+ # Passes if actual.kind_of?(expected)
380
+ #
381
+ # @example
382
+ # expect(5).to be_a_kind_of(Fixnum)
383
+ # expect(5).to be_a_kind_of(Numeric)
384
+ # expect(5).not_to be_a_kind_of(Float)
385
+ def be_a_kind_of(expected)
386
+ BuiltIn::BeAKindOf.new(expected)
387
+ end
388
+ alias_method :be_kind_of, :be_a_kind_of
389
+ alias_matcher :a_kind_of, :be_a_kind_of
390
+
391
+ # Passes if actual.between?(min, max). Works with any Comparable object,
392
+ # including String, Symbol, Time, or Numeric (Fixnum, Bignum, Integer,
393
+ # Float, Complex, and Rational).
394
+ #
395
+ # By default, `be_between` is inclusive (i.e. passes when given either the max or min value),
396
+ # but you can make it `exclusive` by chaining that off the matcher.
397
+ #
398
+ # @example
399
+ # expect(5).to be_between(1, 10)
400
+ # expect(11).not_to be_between(1, 10)
401
+ # expect(10).not_to be_between(1, 10).exclusive
402
+ def be_between(min, max)
403
+ BuiltIn::BeBetween.new(min, max)
404
+ end
405
+ alias_matcher :a_value_between, :be_between
406
+
407
+ # Passes if actual == expected +/- delta
408
+ #
409
+ # @example
410
+ # expect(result).to be_within(0.5).of(3.0)
411
+ # expect(result).not_to be_within(0.5).of(3.0)
412
+ def be_within(delta)
413
+ BuiltIn::BeWithin.new(delta)
414
+ end
415
+ alias_matcher :a_value_within, :be_within
416
+ alias_matcher :within, :be_within
417
+
418
+ # Applied to a proc, specifies that its execution will cause some value to
419
+ # change.
420
+ #
421
+ # @param [Object] receiver
422
+ # @param [Symbol] message the message to send the receiver
423
+ #
424
+ # You can either pass <tt>receiver</tt> and <tt>message</tt>, or a block,
425
+ # but not both.
426
+ #
427
+ # When passing a block, it must use the `{ ... }` format, not
428
+ # do/end, as `{ ... }` binds to the `change` method, whereas do/end
429
+ # would errantly bind to the `expect(..).to` or `expect(...).not_to` method.
430
+ #
431
+ # You can chain any of the following off of the end to specify details
432
+ # about the change:
433
+ #
434
+ # * `from`
435
+ # * `to`
436
+ #
437
+ # or any one of:
438
+ #
439
+ # * `by`
440
+ # * `by_at_least`
441
+ # * `by_at_most`
442
+ #
443
+ # @example
444
+ # expect {
445
+ # team.add_player(player)
446
+ # }.to change(roster, :count)
447
+ #
448
+ # expect {
449
+ # team.add_player(player)
450
+ # }.to change(roster, :count).by(1)
451
+ #
452
+ # expect {
453
+ # team.add_player(player)
454
+ # }.to change(roster, :count).by_at_least(1)
455
+ #
456
+ # expect {
457
+ # team.add_player(player)
458
+ # }.to change(roster, :count).by_at_most(1)
459
+ #
460
+ # string = "string"
461
+ # expect {
462
+ # string.reverse!
463
+ # }.to change { string }.from("string").to("gnirts")
464
+ #
465
+ # string = "string"
466
+ # expect {
467
+ # string
468
+ # }.not_to change { string }.from("string")
469
+ #
470
+ # expect {
471
+ # person.happy_birthday
472
+ # }.to change(person, :birthday).from(32).to(33)
473
+ #
474
+ # expect {
475
+ # employee.develop_great_new_social_networking_app
476
+ # }.to change(employee, :title).from("Mail Clerk").to("CEO")
477
+ #
478
+ # expect {
479
+ # doctor.leave_office
480
+ # }.to change(doctor, :sign).from(/is in/).to(/is out/)
481
+ #
482
+ # user = User.new(:type => "admin")
483
+ # expect {
484
+ # user.symbolize_type
485
+ # }.to change(user, :type).from(String).to(Symbol)
486
+ #
487
+ # == Notes
488
+ #
489
+ # Evaluates `receiver.message` or `block` before and after it
490
+ # evaluates the block passed to `expect`.
491
+ #
492
+ # `expect( ... ).not_to change` supports the form that specifies `from`
493
+ # (which specifies what you expect the starting, unchanged value to be)
494
+ # but does not support forms with subsequent calls to `by`, `by_at_least`,
495
+ # `by_at_most` or `to`.
496
+ def change(receiver=nil, message=nil, &block)
497
+ BuiltIn::Change.new(receiver, message, &block)
498
+ end
499
+ alias_matcher :a_block_changing, :change
500
+ alias_matcher :changing, :change
501
+
502
+ # Passes if actual contains all of the expected regardless of order.
503
+ # This works for collections. Pass in multiple args and it will only
504
+ # pass if all args are found in collection.
505
+ #
506
+ # @note This is also available using the `=~` operator with `should`,
507
+ # but `=~` is not supported with `expect`.
508
+ #
509
+ # @example
510
+ # expect([1, 2, 3]).to contain_exactly(1, 2, 3)
511
+ # expect([1, 2, 3]).to contain_exactly(1, 3, 2)
512
+ #
513
+ # @see #match_array
514
+ def contain_exactly(*items)
515
+ BuiltIn::ContainExactly.new(items)
516
+ end
517
+ alias_matcher :a_collection_containing_exactly, :contain_exactly
518
+ alias_matcher :containing_exactly, :contain_exactly
519
+
520
+ # Passes if actual covers expected. This works for
521
+ # Ranges. You can also pass in multiple args
522
+ # and it will only pass if all args are found in Range.
523
+ #
524
+ # @example
525
+ # expect(1..10).to cover(5)
526
+ # expect(1..10).to cover(4, 6)
527
+ # expect(1..10).to cover(4, 6, 11) # fails
528
+ # expect(1..10).not_to cover(11)
529
+ # expect(1..10).not_to cover(5) # fails
530
+ #
531
+ # ### Warning:: Ruby >= 1.9 only
532
+ def cover(*values)
533
+ BuiltIn::Cover.new(*values)
534
+ end
535
+ alias_matcher :a_range_covering, :cover
536
+ alias_matcher :covering, :cover
537
+
538
+ # Matches if the actual value ends with the expected value(s). In the case
539
+ # of a string, matches against the last `expected.length` characters of the
540
+ # actual string. In the case of an array, matches against the last
541
+ # `expected.length` elements of the actual array.
542
+ #
543
+ # @example
544
+ # expect("this string").to end_with "string"
545
+ # expect([0, 1, 2, 3, 4]).to end_with 4
546
+ # expect([0, 2, 3, 4, 4]).to end_with 3, 4
547
+ def end_with(*expected)
548
+ BuiltIn::EndWith.new(*expected)
549
+ end
550
+ alias_matcher :a_collection_ending_with, :end_with
551
+ alias_matcher :a_string_ending_with, :end_with
552
+ alias_matcher :ending_with, :end_with
553
+
554
+ # Passes if <tt>actual == expected</tt>.
555
+ #
556
+ # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more
557
+ # information about equality in Ruby.
558
+ #
559
+ # @example
560
+ # expect(5).to eq(5)
561
+ # expect(5).not_to eq(3)
562
+ def eq(expected)
563
+ BuiltIn::Eq.new(expected)
564
+ end
565
+ alias_matcher :an_object_eq_to, :eq
566
+ alias_matcher :eq_to, :eq
567
+
568
+ # Passes if `actual.eql?(expected)`
569
+ #
570
+ # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more
571
+ # information about equality in Ruby.
572
+ #
573
+ # @example
574
+ # expect(5).to eql(5)
575
+ # expect(5).not_to eql(3)
576
+ def eql(expected)
577
+ BuiltIn::Eql.new(expected)
578
+ end
579
+ alias_matcher :an_object_eql_to, :eql
580
+ alias_matcher :eql_to, :eql
581
+
582
+ # Passes if <tt>actual.equal?(expected)</tt> (object identity).
583
+ #
584
+ # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more
585
+ # information about equality in Ruby.
586
+ #
587
+ # @example
588
+ # expect(5).to equal(5) # Fixnums are equal
589
+ # expect("5").not_to equal("5") # Strings that look the same are not the same object
590
+ def equal(expected)
591
+ BuiltIn::Equal.new(expected)
592
+ end
593
+ alias_matcher :an_object_equal_to, :equal
594
+ alias_matcher :equal_to, :equal
595
+
596
+ # Passes if `actual.exist?` or `actual.exists?`
597
+ #
598
+ # @example
599
+ # expect(File).to exist("path/to/file")
600
+ def exist(*args)
601
+ BuiltIn::Exist.new(*args)
602
+ end
603
+ alias_matcher :an_object_existing, :exist
604
+ alias_matcher :existing, :exist
605
+
606
+ # Passes if actual's attribute values match the expected attributes hash.
607
+ # This works no matter how you define your attribute readers.
608
+ #
609
+ # @example
610
+ # Person = Struct.new(:name, :age)
611
+ # person = Person.new("Bob", 32)
612
+ #
613
+ # expect(person).to have_attributes(:name => "Bob", :age => 32)
614
+ # expect(person).to have_attributes(:name => a_string_starting_with("B"), :age => (a_value > 30) )
615
+ #
616
+ # @note It will fail if actual doesn't respond to any of the expected attributes.
617
+ #
618
+ # @example
619
+ # expect(person).to have_attributes(:color => "red")
620
+ def have_attributes(expected)
621
+ BuiltIn::HaveAttributes.new(expected)
622
+ end
623
+ alias_matcher :an_object_having_attributes, :have_attributes
624
+
625
+ # Passes if actual includes expected. This works for
626
+ # collections and Strings. You can also pass in multiple args
627
+ # and it will only pass if all args are found in collection.
628
+ #
629
+ # @example
630
+ # expect([1,2,3]).to include(3)
631
+ # expect([1,2,3]).to include(2,3)
632
+ # expect([1,2,3]).to include(2,3,4) # fails
633
+ # expect([1,2,3]).not_to include(4)
634
+ # expect("spread").to include("read")
635
+ # expect("spread").not_to include("red")
636
+ # expect(:a => 1, :b => 2).to include(:a)
637
+ # expect(:a => 1, :b => 2).to include(:a, :b)
638
+ # expect(:a => 1, :b => 2).to include(:a => 1)
639
+ # expect(:a => 1, :b => 2).to include(:b => 2, :a => 1)
640
+ # expect(:a => 1, :b => 2).to include(:c) # fails
641
+ # expect(:a => 1, :b => 2).not_to include(:a => 2)
642
+ def include(*expected)
643
+ BuiltIn::Include.new(*expected)
644
+ end
645
+ alias_matcher :a_collection_including, :include
646
+ alias_matcher :a_string_including, :include
647
+ alias_matcher :a_hash_including, :include
648
+ alias_matcher :including, :include
649
+
650
+ # Passes if the provided matcher passes when checked against all
651
+ # elements of the collection.
652
+ #
653
+ # @example
654
+ # expect([1, 3, 5]).to all be_odd
655
+ # expect([1, 3, 6]).to all be_odd # fails
656
+ #
657
+ # @note The negative form `not_to all` is not supported. Instead
658
+ # use `not_to include` or pass a negative form of a matcher
659
+ # as the argument (e.g. `all exclude(:foo)`).
660
+ #
661
+ # @note You can also use this with compound matchers as well.
662
+ #
663
+ # @example
664
+ # expect([1, 3, 5]).to all( be_odd.and be_an(Integer) )
665
+ def all(expected)
666
+ BuiltIn::All.new(expected)
667
+ end
668
+
669
+ # Given a `Regexp` or `String`, passes if `actual.match(pattern)`
670
+ # Given an arbitrary nested data structure (e.g. arrays and hashes),
671
+ # matches if `expected === actual` || `actual == expected` for each
672
+ # pair of elements.
673
+ #
674
+ # @example
675
+ # expect(email).to match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i)
676
+ # expect(email).to match("@example.com")
677
+ #
678
+ # @example
679
+ # hash = {
680
+ # :a => {
681
+ # :b => ["foo", 5],
682
+ # :c => { :d => 2.05 }
683
+ # }
684
+ # }
685
+ #
686
+ # expect(hash).to match(
687
+ # :a => {
688
+ # :b => a_collection_containing_exactly(
689
+ # a_string_starting_with("f"),
690
+ # an_instance_of(Fixnum)
691
+ # ),
692
+ # :c => { :d => (a_value < 3) }
693
+ # }
694
+ # )
695
+ #
696
+ # @note The `match_regex` alias is deprecated and is not recommended for use.
697
+ # It was added in 2.12.1 to facilitate its use from within custom
698
+ # matchers (due to how the custom matcher DSL was evaluated in 2.x,
699
+ # `match` could not be used there), but is no longer needed in 3.x.
700
+ def match(expected)
701
+ BuiltIn::Match.new(expected)
702
+ end
703
+ alias_matcher :match_regex, :match
704
+ alias_matcher :an_object_matching, :match
705
+ alias_matcher :a_string_matching, :match
706
+ alias_matcher :matching, :match
707
+
708
+ # An alternate form of `contain_exactly` that accepts
709
+ # the expected contents as a single array arg rather
710
+ # that splatted out as individual items.
711
+ #
712
+ # @example
713
+ # expect(results).to contain_exactly(1, 2)
714
+ # # is identical to:
715
+ # expect(results).to match_array([1, 2])
716
+ #
717
+ # @see #contain_exactly
718
+ def match_array(items)
719
+ contain_exactly(*items)
720
+ end
721
+
722
+ # With no arg, passes if the block outputs `to_stdout` or `to_stderr`.
723
+ # With a string, passes if the block outputs that specific string `to_stdout` or `to_stderr`.
724
+ # With a regexp or matcher, passes if the block outputs a string `to_stdout` or `to_stderr` that matches.
725
+ #
726
+ # To capture output from any spawned subprocess as well, use `to_stdout_from_any_process` or
727
+ # `to_stderr_from_any_process`. Output from any process that inherits the main process's corresponding
728
+ # standard stream will be captured.
729
+ #
730
+ # @example
731
+ # expect { print 'foo' }.to output.to_stdout
732
+ # expect { print 'foo' }.to output('foo').to_stdout
733
+ # expect { print 'foo' }.to output(/foo/).to_stdout
734
+ #
735
+ # expect { do_something }.to_not output.to_stdout
736
+ #
737
+ # expect { warn('foo') }.to output.to_stderr
738
+ # expect { warn('foo') }.to output('foo').to_stderr
739
+ # expect { warn('foo') }.to output(/foo/).to_stderr
740
+ #
741
+ # expect { do_something }.to_not output.to_stderr
742
+ #
743
+ # expect { system('echo foo') }.to output("foo\n").to_stdout_from_any_process
744
+ # expect { system('echo foo', out: :err) }.to output("foo\n").to_stderr_from_any_process
745
+ #
746
+ # @note `to_stdout` and `to_stderr` work by temporarily replacing `$stdout` or `$stderr`,
747
+ # so they're not able to intercept stream output that explicitly uses `STDOUT`/`STDERR`
748
+ # or that uses a reference to `$stdout`/`$stderr` that was stored before the
749
+ # matcher was used.
750
+ # @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and
751
+ # are thus significantly (~30x) slower than `to_stdout` and `to_stderr`.
752
+ def output(expected=nil)
753
+ BuiltIn::Output.new(expected)
754
+ end
755
+ alias_matcher :a_block_outputting, :output
756
+
757
+ # With no args, matches if any error is raised.
758
+ # With a named error, matches only if that specific error is raised.
759
+ # With a named error and messsage specified as a String, matches only if both match.
760
+ # With a named error and messsage specified as a Regexp, matches only if both match.
761
+ # Pass an optional block to perform extra verifications on the exception matched
762
+ #
763
+ # @example
764
+ # expect { do_something_risky }.to raise_error
765
+ # expect { do_something_risky }.to raise_error(PoorRiskDecisionError)
766
+ # expect { do_something_risky }.to raise_error(PoorRiskDecisionError) { |error| expect(error.data).to eq 42 }
767
+ # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, "that was too risky")
768
+ # expect { do_something_risky }.to raise_error(PoorRiskDecisionError, /oo ri/)
769
+ #
770
+ # expect { do_something_risky }.not_to raise_error
771
+ def raise_error(error=nil, message=nil, &block)
772
+ BuiltIn::RaiseError.new(error, message, &block)
773
+ end
774
+ alias_method :raise_exception, :raise_error
775
+
776
+ alias_matcher :a_block_raising, :raise_error do |desc|
777
+ desc.sub("raise", "a block raising")
778
+ end
779
+
780
+ alias_matcher :raising, :raise_error do |desc|
781
+ desc.sub("raise", "raising")
782
+ end
783
+
784
+ # Matches if the target object responds to all of the names
785
+ # provided. Names can be Strings or Symbols.
786
+ #
787
+ # @example
788
+ # expect("string").to respond_to(:length)
789
+ #
790
+ def respond_to(*names)
791
+ BuiltIn::RespondTo.new(*names)
792
+ end
793
+ alias_matcher :an_object_responding_to, :respond_to
794
+ alias_matcher :responding_to, :respond_to
795
+
796
+ # Passes if the submitted block returns true. Yields target to the
797
+ # block.
798
+ #
799
+ # Generally speaking, this should be thought of as a last resort when
800
+ # you can't find any other way to specify the behaviour you wish to
801
+ # specify.
802
+ #
803
+ # If you do find yourself in such a situation, you could always write
804
+ # a custom matcher, which would likely make your specs more expressive.
805
+ #
806
+ # @param description [String] optional description to be used for this matcher.
807
+ #
808
+ # @example
809
+ # expect(5).to satisfy { |n| n > 3 }
810
+ # expect(5).to satisfy("be greater than 3") { |n| n > 3 }
811
+ def satisfy(description="satisfy block", &block)
812
+ BuiltIn::Satisfy.new(description, &block)
813
+ end
814
+ alias_matcher :an_object_satisfying, :satisfy
815
+ alias_matcher :satisfying, :satisfy
816
+
817
+ # Matches if the actual value starts with the expected value(s). In the
818
+ # case of a string, matches against the first `expected.length` characters
819
+ # of the actual string. In the case of an array, matches against the first
820
+ # `expected.length` elements of the actual array.
821
+ #
822
+ # @example
823
+ # expect("this string").to start_with "this s"
824
+ # expect([0, 1, 2, 3, 4]).to start_with 0
825
+ # expect([0, 2, 3, 4, 4]).to start_with 0, 1
826
+ def start_with(*expected)
827
+ BuiltIn::StartWith.new(*expected)
828
+ end
829
+ alias_matcher :a_collection_starting_with, :start_with
830
+ alias_matcher :a_string_starting_with, :start_with
831
+ alias_matcher :starting_with, :start_with
832
+
833
+ # Given no argument, matches if a proc throws any Symbol.
834
+ #
835
+ # Given a Symbol, matches if the given proc throws the specified Symbol.
836
+ #
837
+ # Given a Symbol and an arg, matches if the given proc throws the
838
+ # specified Symbol with the specified arg.
839
+ #
840
+ # @example
841
+ # expect { do_something_risky }.to throw_symbol
842
+ # expect { do_something_risky }.to throw_symbol(:that_was_risky)
843
+ # expect { do_something_risky }.to throw_symbol(:that_was_risky, 'culprit')
844
+ #
845
+ # expect { do_something_risky }.not_to throw_symbol
846
+ # expect { do_something_risky }.not_to throw_symbol(:that_was_risky)
847
+ # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit')
848
+ def throw_symbol(expected_symbol=nil, expected_arg=nil)
849
+ BuiltIn::ThrowSymbol.new(expected_symbol, expected_arg)
850
+ end
851
+
852
+ alias_matcher :a_block_throwing, :throw_symbol do |desc|
853
+ desc.sub("throw", "a block throwing")
854
+ end
855
+
856
+ alias_matcher :throwing, :throw_symbol do |desc|
857
+ desc.sub("throw", "throwing")
858
+ end
859
+
860
+ # Passes if the method called in the expect block yields, regardless
861
+ # of whether or not arguments are yielded.
862
+ #
863
+ # @example
864
+ # expect { |b| 5.tap(&b) }.to yield_control
865
+ # expect { |b| "a".to_sym(&b) }.not_to yield_control
866
+ #
867
+ # @note Your expect block must accept a parameter and pass it on to
868
+ # the method-under-test as a block.
869
+ def yield_control
870
+ BuiltIn::YieldControl.new
871
+ end
872
+ alias_matcher :a_block_yielding_control, :yield_control
873
+ alias_matcher :yielding_control, :yield_control
874
+
875
+ # Passes if the method called in the expect block yields with
876
+ # no arguments. Fails if it does not yield, or yields with arguments.
877
+ #
878
+ # @example
879
+ # expect { |b| User.transaction(&b) }.to yield_with_no_args
880
+ # expect { |b| 5.tap(&b) }.not_to yield_with_no_args # because it yields with `5`
881
+ # expect { |b| "a".to_sym(&b) }.not_to yield_with_no_args # because it does not yield
882
+ #
883
+ # @note Your expect block must accept a parameter and pass it on to
884
+ # the method-under-test as a block.
885
+ # @note This matcher is not designed for use with methods that yield
886
+ # multiple times.
887
+ def yield_with_no_args
888
+ BuiltIn::YieldWithNoArgs.new
889
+ end
890
+ alias_matcher :a_block_yielding_with_no_args, :yield_with_no_args
891
+ alias_matcher :yielding_with_no_args, :yield_with_no_args
892
+
893
+ # Given no arguments, matches if the method called in the expect
894
+ # block yields with arguments (regardless of what they are or how
895
+ # many there are).
896
+ #
897
+ # Given arguments, matches if the method called in the expect block
898
+ # yields with arguments that match the given arguments.
899
+ #
900
+ # Argument matching is done using `===` (the case match operator)
901
+ # and `==`. If the expected and actual arguments match with either
902
+ # operator, the matcher will pass.
903
+ #
904
+ # @example
905
+ # expect { |b| 5.tap(&b) }.to yield_with_args # because #tap yields an arg
906
+ # expect { |b| 5.tap(&b) }.to yield_with_args(5) # because 5 == 5
907
+ # expect { |b| 5.tap(&b) }.to yield_with_args(Fixnum) # because Fixnum === 5
908
+ # expect { |b| File.open("f.txt", &b) }.to yield_with_args(/txt/) # because /txt/ === "f.txt"
909
+ #
910
+ # expect { |b| User.transaction(&b) }.not_to yield_with_args # because it yields no args
911
+ # expect { |b| 5.tap(&b) }.not_to yield_with_args(1, 2, 3)
912
+ #
913
+ # @note Your expect block must accept a parameter and pass it on to
914
+ # the method-under-test as a block.
915
+ # @note This matcher is not designed for use with methods that yield
916
+ # multiple times.
917
+ def yield_with_args(*args)
918
+ BuiltIn::YieldWithArgs.new(*args)
919
+ end
920
+ alias_matcher :a_block_yielding_with_args, :yield_with_args
921
+ alias_matcher :yielding_with_args, :yield_with_args
922
+
923
+ # Designed for use with methods that repeatedly yield (such as
924
+ # iterators). Passes if the method called in the expect block yields
925
+ # multiple times with arguments matching those given.
926
+ #
927
+ # Argument matching is done using `===` (the case match operator)
928
+ # and `==`. If the expected and actual arguments match with either
929
+ # operator, the matcher will pass.
930
+ #
931
+ # @example
932
+ # expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3)
933
+ # expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2])
934
+ # expect { |b| [1, 2, 3].each(&b) }.not_to yield_successive_args(1, 2)
935
+ #
936
+ # @note Your expect block must accept a parameter and pass it on to
937
+ # the method-under-test as a block.
938
+ def yield_successive_args(*args)
939
+ BuiltIn::YieldSuccessiveArgs.new(*args)
940
+ end
941
+ alias_matcher :a_block_yielding_successive_args, :yield_successive_args
942
+ alias_matcher :yielding_successive_args, :yield_successive_args
943
+
944
+ # Delegates to {RSpec::Expectations.configuration}.
945
+ # This is here because rspec-core's `expect_with` option
946
+ # looks for a `configuration` method on the mixin
947
+ # (`RSpec::Matchers`) to yield to a block.
948
+ # @return [RSpec::Expectations::Configuration] the configuration object
949
+ def self.configuration
950
+ Expectations.configuration
951
+ end
952
+
953
+ private
954
+
955
+ BE_PREDICATE_REGEX = /^(be_(?:an?_)?)(.*)/
956
+ HAS_REGEX = /^(?:have_)(.*)/
957
+ DYNAMIC_MATCHER_REGEX = Regexp.union(BE_PREDICATE_REGEX, HAS_REGEX)
958
+
959
+ def method_missing(method, *args, &block)
960
+ case method.to_s
961
+ when BE_PREDICATE_REGEX
962
+ BuiltIn::BePredicate.new(method, *args, &block)
963
+ when HAS_REGEX
964
+ BuiltIn::Has.new(method, *args, &block)
965
+ else
966
+ super
967
+ end
968
+ end
969
+
970
+ if RUBY_VERSION.to_f >= 1.9
971
+ def respond_to_missing?(method, *)
972
+ method =~ DYNAMIC_MATCHER_REGEX || super
973
+ end
974
+ else # for 1.8.7
975
+ # :nocov:
976
+ def respond_to?(method, *)
977
+ method = method.to_s
978
+ method =~ DYNAMIC_MATCHER_REGEX || super
979
+ end
980
+ public :respond_to?
981
+ # :nocov:
982
+ end
983
+
984
+ # @api private
985
+ def self.is_a_matcher?(obj)
986
+ return true if ::RSpec::Matchers::BuiltIn::BaseMatcher === obj
987
+ begin
988
+ return false if obj.respond_to?(:i_respond_to_everything_so_im_not_really_a_matcher)
989
+ rescue NoMethodError
990
+ # Some objects, like BasicObject, don't implemented standard
991
+ # reflection methods.
992
+ return false
993
+ end
994
+ return false unless obj.respond_to?(:matches?)
995
+
996
+ obj.respond_to?(:failure_message) ||
997
+ obj.respond_to?(:failure_message_for_should) # support legacy matchers
998
+ end
999
+
1000
+ ::RSpec::Support.register_matcher_definition do |obj|
1001
+ is_a_matcher?(obj)
1002
+ end
1003
+
1004
+ # @api private
1005
+ def self.is_a_describable_matcher?(obj)
1006
+ is_a_matcher?(obj) && obj.respond_to?(:description)
1007
+ end
1008
+
1009
+ if RSpec::Support::Ruby.mri? && RUBY_VERSION[0, 3] == '1.9'
1010
+ # @api private
1011
+ # Note that `included` doesn't work for this because it is triggered
1012
+ # _after_ `RSpec::Matchers` is an ancestor of the inclusion host, rather
1013
+ # than _before_, like `append_features`. It's important we check this before
1014
+ # in order to find the cases where it was already previously included.
1015
+ def self.append_features(mod)
1016
+ return super if mod < self # `mod < self` indicates a re-inclusion.
1017
+
1018
+ subclasses = ObjectSpace.each_object(Class).select { |c| c < mod && c < self }
1019
+ return super unless subclasses.any?
1020
+
1021
+ subclasses.reject! { |s| subclasses.any? { |s2| s < s2 } } # Filter to the root ancestor.
1022
+ subclasses = subclasses.map { |s| "`#{s}`" }.join(", ")
1023
+
1024
+ RSpec.warning "`#{self}` has been included in a superclass (`#{mod}`) " \
1025
+ "after previously being included in subclasses (#{subclasses}), " \
1026
+ "which can trigger infinite recursion from `super` due to an MRI 1.9 bug " \
1027
+ "(https://redmine.ruby-lang.org/issues/3351). To work around this, " \
1028
+ "either upgrade to MRI 2.0+, include a dup of the module (e.g. " \
1029
+ "`include #{self}.dup`), or find a way to include `#{self}` in `#{mod}` " \
1030
+ "before it is included in subclasses (#{subclasses}). See " \
1031
+ "https://github.com/rspec/rspec-expectations/issues/814 for more info"
1032
+
1033
+ super
1034
+ end
1035
+ end
1036
+ end
1037
+ end