jscop 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (479) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.replit +1 -1
  4. data/.rubocop.yml +2 -1
  5. data/.stickler.yml +2 -1
  6. data/.travis.yml +7 -0
  7. data/Gemfile +2 -2
  8. data/README.md +49 -34
  9. data/bin/console +2 -2
  10. data/exe/jscop +1 -2
  11. data/jscop.gemspec +20 -23
  12. data/lib/helpers/lint_ware.rb +1 -1
  13. data/lib/jscop/version.rb +1 -1
  14. data/lib/jscop.rb +1 -1
  15. metadata +4 -467
  16. data/Gemfile.lock +0 -59
  17. data/vendor/cache/ruby/2.6.0/bin/htmldiff +0 -29
  18. data/vendor/cache/ruby/2.6.0/bin/ldiff +0 -29
  19. data/vendor/cache/ruby/2.6.0/bin/rake +0 -27
  20. data/vendor/cache/ruby/2.6.0/bin/rspec +0 -27
  21. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/CHANGELOG +0 -65
  22. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/LICENSE +0 -339
  23. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/README.md +0 -105
  24. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/Rakefile +0 -13
  25. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/colorize.gemspec +0 -36
  26. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/lib/colorize/class_methods.rb +0 -120
  27. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/lib/colorize/instance_methods.rb +0 -132
  28. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/lib/colorize.rb +0 -12
  29. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/lib/colorized_string.rb +0 -19
  30. data/vendor/cache/ruby/2.6.0/gems/colorize-0.8.1/test/test_colorize.rb +0 -164
  31. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/.rspec +0 -1
  32. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/Code-of-Conduct.md +0 -74
  33. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/Contributing.md +0 -83
  34. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/History.md +0 -220
  35. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/License.md +0 -39
  36. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/Manifest.txt +0 -37
  37. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/README.rdoc +0 -84
  38. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/Rakefile +0 -57
  39. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/autotest/discover.rb +0 -1
  40. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/bin/htmldiff +0 -32
  41. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/bin/ldiff +0 -6
  42. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/docs/COPYING.txt +0 -339
  43. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/docs/artistic.txt +0 -127
  44. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/array.rb +0 -7
  45. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/block.rb +0 -37
  46. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/callbacks.rb +0 -322
  47. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/change.rb +0 -181
  48. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/htmldiff.rb +0 -149
  49. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/hunk.rb +0 -276
  50. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/internals.rb +0 -307
  51. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/ldiff.rb +0 -167
  52. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs/string.rb +0 -5
  53. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff/lcs.rb +0 -725
  54. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff-lcs.rb +0 -3
  55. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/change_spec.rb +0 -65
  56. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/diff_spec.rb +0 -47
  57. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/fixtures/ds1.csv +0 -50
  58. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/fixtures/ds2.csv +0 -51
  59. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/hunk_spec.rb +0 -72
  60. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/issues_spec.rb +0 -49
  61. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/lcs_spec.rb +0 -56
  62. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/ldiff_spec.rb +0 -47
  63. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/patch_spec.rb +0 -422
  64. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/sdiff_spec.rb +0 -214
  65. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/spec_helper.rb +0 -321
  66. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/traverse_balanced_spec.rb +0 -310
  67. data/vendor/cache/ruby/2.6.0/gems/diff-lcs-1.3/spec/traverse_sequences_spec.rb +0 -139
  68. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/.autotest +0 -7
  69. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/.rubocop.yml +0 -27
  70. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/.togglerc +0 -7
  71. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/CONTRIBUTING.rdoc +0 -38
  72. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/History.rdoc +0 -659
  73. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/MIT-LICENSE +0 -21
  74. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/Manifest.txt +0 -166
  75. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/README.rdoc +0 -139
  76. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/Rakefile +0 -81
  77. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/bin/rake +0 -33
  78. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/command_line_usage.rdoc +0 -158
  79. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/example/Rakefile1 +0 -38
  80. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/example/Rakefile2 +0 -35
  81. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/example/a.c +0 -6
  82. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/example/b.c +0 -6
  83. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/example/main.c +0 -11
  84. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/glossary.rdoc +0 -42
  85. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/jamis.rb +0 -591
  86. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/proto_rake.rdoc +0 -127
  87. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/rake.1 +0 -141
  88. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/rakefile.rdoc +0 -624
  89. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/rational.rdoc +0 -151
  90. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +0 -23
  91. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +0 -35
  92. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +0 -53
  93. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +0 -78
  94. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +0 -46
  95. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +0 -141
  96. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +0 -119
  97. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +0 -59
  98. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +0 -121
  99. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +0 -47
  100. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +0 -114
  101. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +0 -165
  102. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +0 -112
  103. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +0 -147
  104. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +0 -53
  105. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +0 -37
  106. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +0 -55
  107. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +0 -112
  108. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +0 -52
  109. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +0 -55
  110. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +0 -49
  111. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +0 -102
  112. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +0 -60
  113. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +0 -55
  114. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +0 -64
  115. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +0 -178
  116. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +0 -58
  117. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +0 -53
  118. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +0 -191
  119. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +0 -61
  120. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/alt_system.rb +0 -110
  121. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/application.rb +0 -790
  122. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/backtrace.rb +0 -23
  123. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/clean.rb +0 -76
  124. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/cloneable.rb +0 -16
  125. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/.document +0 -1
  126. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +0 -21
  127. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +0 -137
  128. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +0 -81
  129. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +0 -18
  130. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +0 -61
  131. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/contrib/sys.rb +0 -4
  132. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/cpu_counter.rb +0 -125
  133. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/default_loader.rb +0 -14
  134. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/dsl_definition.rb +0 -201
  135. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/early_time.rb +0 -21
  136. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb +0 -25
  137. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/module.rb +0 -2
  138. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/pathname.rb +0 -25
  139. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/string.rb +0 -175
  140. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/time.rb +0 -18
  141. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_creation_task.rb +0 -24
  142. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_list.rb +0 -428
  143. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_task.rb +0 -46
  144. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_utils.rb +0 -128
  145. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +0 -144
  146. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/gempackagetask.rb +0 -4
  147. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/invocation_chain.rb +0 -56
  148. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +0 -16
  149. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/late_time.rb +0 -17
  150. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/linked_list.rb +0 -103
  151. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +0 -53
  152. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/multi_task.rb +0 -13
  153. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/name_space.rb +0 -38
  154. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/packagetask.rb +0 -199
  155. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/pathmap.rb +0 -3
  156. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/phony.rb +0 -15
  157. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/private_reader.rb +0 -20
  158. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/promise.rb +0 -99
  159. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/pseudo_status.rb +0 -29
  160. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rake_module.rb +0 -38
  161. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +0 -22
  162. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rdoctask.rb +0 -4
  163. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +0 -29
  164. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +0 -20
  165. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/runtest.rb +0 -27
  166. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/scope.rb +0 -42
  167. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task.rb +0 -383
  168. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task_argument_error.rb +0 -7
  169. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task_arguments.rb +0 -98
  170. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/task_manager.rb +0 -307
  171. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/tasklib.rb +0 -24
  172. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/testtask.rb +0 -213
  173. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/thread_history_display.rb +0 -48
  174. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/thread_pool.rb +0 -164
  175. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/trace_output.rb +0 -22
  176. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/version.rb +0 -7
  177. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/win32.rb +0 -56
  178. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake.rb +0 -79
  179. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/publish.rake +0 -20
  180. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/rakelib/test_times.rake +0 -25
  181. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/file_creation.rb +0 -34
  182. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/helper.rb +0 -129
  183. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/support/rakefile_definitions.rb +0 -478
  184. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/support/ruby_runner.rb +0 -34
  185. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_private_reader.rb +0 -42
  186. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake.rb +0 -40
  187. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_application.rb +0 -643
  188. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_application_options.rb +0 -468
  189. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_backtrace.rb +0 -119
  190. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_clean.rb +0 -61
  191. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +0 -68
  192. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_definitions.rb +0 -84
  193. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_directory_task.rb +0 -76
  194. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_dsl.rb +0 -40
  195. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_early_time.rb +0 -31
  196. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_extension.rb +0 -59
  197. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +0 -56
  198. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_list.rb +0 -670
  199. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +0 -8
  200. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_task.rb +0 -197
  201. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_file_utils.rb +0 -314
  202. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_ftp_file.rb +0 -74
  203. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_functional.rb +0 -482
  204. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +0 -64
  205. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_late_time.rb +0 -18
  206. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_linked_list.rb +0 -84
  207. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +0 -46
  208. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_multi_task.rb +0 -64
  209. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_name_space.rb +0 -57
  210. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_package_task.rb +0 -79
  211. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_path_map.rb +0 -168
  212. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +0 -34
  213. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +0 -18
  214. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +0 -15
  215. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +0 -21
  216. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +0 -20
  217. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +0 -26
  218. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_require.rb +0 -40
  219. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_rules.rb +0 -388
  220. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_scope.rb +0 -44
  221. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task.rb +0 -393
  222. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +0 -119
  223. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_arguments.rb +0 -127
  224. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_lib.rb +0 -9
  225. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_manager.rb +0 -178
  226. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +0 -19
  227. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +0 -172
  228. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_test_task.rb +0 -146
  229. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_thread_pool.rb +0 -145
  230. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +0 -71
  231. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_rake_win32.rb +0 -72
  232. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_thread_history_display.rb +0 -101
  233. data/vendor/cache/ruby/2.6.0/gems/rake-10.5.0/test/test_trace_output.rb +0 -52
  234. data/vendor/cache/ruby/2.6.0/gems/rspec-3.9.0/LICENSE.md +0 -27
  235. data/vendor/cache/ruby/2.6.0/gems/rspec-3.9.0/README.md +0 -43
  236. data/vendor/cache/ruby/2.6.0/gems/rspec-3.9.0/lib/rspec/version.rb +0 -5
  237. data/vendor/cache/ruby/2.6.0/gems/rspec-3.9.0/lib/rspec.rb +0 -3
  238. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/.document +0 -5
  239. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/.yardopts +0 -8
  240. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/Changelog.md +0 -2274
  241. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/LICENSE.md +0 -26
  242. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/README.md +0 -384
  243. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/exe/rspec +0 -4
  244. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/autorun.rb +0 -3
  245. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/backtrace_formatter.rb +0 -65
  246. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/coordinator.rb +0 -62
  247. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/example_minimizer.rb +0 -173
  248. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/fork_runner.rb +0 -135
  249. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/server.rb +0 -61
  250. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/shell_command.rb +0 -126
  251. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/shell_runner.rb +0 -73
  252. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/bisect/utilities.rb +0 -58
  253. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb +0 -2336
  254. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/configuration_options.rb +0 -233
  255. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/did_you_mean.rb +0 -46
  256. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/drb.rb +0 -113
  257. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/dsl.rb +0 -98
  258. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb +0 -656
  259. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb +0 -889
  260. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_status_persister.rb +0 -235
  261. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/filter_manager.rb +0 -231
  262. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/flat_map.rb +0 -20
  263. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/base_bisect_formatter.rb +0 -45
  264. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/base_formatter.rb +0 -70
  265. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/base_text_formatter.rb +0 -75
  266. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/bisect_drb_formatter.rb +0 -29
  267. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/bisect_progress_formatter.rb +0 -157
  268. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/console_codes.rb +0 -68
  269. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/deprecation_formatter.rb +0 -223
  270. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/documentation_formatter.rb +0 -102
  271. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/exception_presenter.rb +0 -508
  272. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/failure_list_formatter.rb +0 -23
  273. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/fallback_message_formatter.rb +0 -28
  274. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/helpers.rb +0 -110
  275. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/html_formatter.rb +0 -153
  276. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/html_printer.rb +0 -414
  277. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/html_snippet_extractor.rb +0 -120
  278. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/json_formatter.rb +0 -102
  279. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/profile_formatter.rb +0 -68
  280. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/progress_formatter.rb +0 -29
  281. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/protocol.rb +0 -182
  282. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/snippet_extractor.rb +0 -134
  283. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters/syntax_highlighter.rb +0 -91
  284. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/formatters.rb +0 -272
  285. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb +0 -632
  286. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/invocations.rb +0 -87
  287. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb +0 -554
  288. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/metadata.rb +0 -498
  289. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/metadata_filter.rb +0 -255
  290. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/minitest_assertions_adapter.rb +0 -31
  291. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/mocking_adapters/flexmock.rb +0 -31
  292. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/mocking_adapters/mocha.rb +0 -57
  293. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/mocking_adapters/null.rb +0 -14
  294. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/mocking_adapters/rr.rb +0 -31
  295. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/mocking_adapters/rspec.rb +0 -32
  296. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/notifications.rb +0 -521
  297. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/option_parser.rb +0 -316
  298. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/ordering.rb +0 -158
  299. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/output_wrapper.rb +0 -29
  300. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/pending.rb +0 -165
  301. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/profiler.rb +0 -34
  302. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/project_initializer/.rspec +0 -1
  303. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/project_initializer/spec/spec_helper.rb +0 -100
  304. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/project_initializer.rb +0 -48
  305. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/rake_task.rb +0 -188
  306. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb +0 -265
  307. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/ruby_project.rb +0 -53
  308. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb +0 -204
  309. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/sandbox.rb +0 -37
  310. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/set.rb +0 -54
  311. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/shared_context.rb +0 -55
  312. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/shared_example_group.rb +0 -269
  313. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/shell_escape.rb +0 -49
  314. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/test_unit_assertions_adapter.rb +0 -30
  315. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/version.rb +0 -9
  316. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/warnings.rb +0 -40
  317. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/world.rb +0 -275
  318. data/vendor/cache/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core.rb +0 -186
  319. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/.document +0 -5
  320. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/.yardopts +0 -6
  321. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/Changelog.md +0 -1178
  322. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/LICENSE.md +0 -25
  323. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/README.md +0 -320
  324. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/block_snippet_extractor.rb +0 -253
  325. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/configuration.rb +0 -215
  326. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/expectation_target.rb +0 -127
  327. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/fail_with.rb +0 -39
  328. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/failure_aggregator.rb +0 -194
  329. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/handler.rb +0 -170
  330. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/minitest_integration.rb +0 -58
  331. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/syntax.rb +0 -132
  332. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations/version.rb +0 -8
  333. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/expectations.rb +0 -82
  334. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/aliased_matcher.rb +0 -116
  335. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/all.rb +0 -86
  336. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/base_matcher.rb +0 -193
  337. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be.rb +0 -288
  338. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_between.rb +0 -77
  339. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_instance_of.rb +0 -26
  340. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_kind_of.rb +0 -20
  341. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/be_within.rb +0 -72
  342. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/change.rb +0 -428
  343. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/compound.rb +0 -276
  344. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/contain_exactly.rb +0 -302
  345. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/cover.rb +0 -24
  346. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/eq.rb +0 -40
  347. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/eql.rb +0 -34
  348. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/equal.rb +0 -81
  349. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/exist.rb +0 -90
  350. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/has.rb +0 -103
  351. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/have_attributes.rb +0 -114
  352. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/include.rb +0 -149
  353. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/match.rb +0 -106
  354. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/operators.rb +0 -128
  355. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/output.rb +0 -200
  356. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/raise_error.rb +0 -230
  357. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/respond_to.rb +0 -199
  358. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/satisfy.rb +0 -60
  359. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/start_or_end_with.rb +0 -94
  360. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/throw_symbol.rb +0 -132
  361. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in/yield.rb +0 -432
  362. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/built_in.rb +0 -52
  363. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/composable.rb +0 -171
  364. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/dsl.rb +0 -534
  365. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/english_phrasing.rb +0 -58
  366. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +0 -82
  367. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/fail_matchers.rb +0 -42
  368. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/generated_descriptions.rb +0 -41
  369. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/matcher_delegator.rb +0 -35
  370. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers/matcher_protocol.rb +0 -99
  371. data/vendor/cache/ruby/2.6.0/gems/rspec-expectations-3.9.1/lib/rspec/matchers.rb +0 -1038
  372. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/.document +0 -5
  373. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/.yardopts +0 -6
  374. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/Changelog.md +0 -1133
  375. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/LICENSE.md +0 -25
  376. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/README.md +0 -463
  377. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/chain.rb +0 -111
  378. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/error_generator.rb +0 -31
  379. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/expect_chain_chain.rb +0 -31
  380. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/expectation_chain.rb +0 -50
  381. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/message_chains.rb +0 -83
  382. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/proxy.rb +0 -116
  383. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/recorder.rb +0 -294
  384. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/stub_chain.rb +0 -51
  385. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance/stub_chain_chain.rb +0 -23
  386. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/any_instance.rb +0 -11
  387. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/argument_list_matcher.rb +0 -100
  388. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/argument_matchers.rb +0 -322
  389. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/configuration.rb +0 -212
  390. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/error_generator.rb +0 -369
  391. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/example_methods.rb +0 -434
  392. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/instance_method_stasher.rb +0 -146
  393. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/marshal_extension.rb +0 -41
  394. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/expectation_customization.rb +0 -20
  395. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/have_received.rb +0 -134
  396. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/receive.rb +0 -132
  397. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/receive_message_chain.rb +0 -82
  398. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/matchers/receive_messages.rb +0 -77
  399. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_chain.rb +0 -87
  400. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_expectation.rb +0 -751
  401. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/method_double.rb +0 -287
  402. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/method_reference.rb +0 -202
  403. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/minitest_integration.rb +0 -68
  404. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/mutate_const.rb +0 -339
  405. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/object_reference.rb +0 -149
  406. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/order_group.rb +0 -81
  407. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/proxy.rb +0 -503
  408. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/space.rb +0 -238
  409. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/standalone.rb +0 -3
  410. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/syntax.rb +0 -325
  411. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/targets.rb +0 -124
  412. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/test_double.rb +0 -171
  413. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/verifying_double.rb +0 -129
  414. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/verifying_message_expectation.rb +0 -54
  415. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/verifying_proxy.rb +0 -220
  416. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/version.rb +0 -9
  417. data/vendor/cache/ruby/2.6.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks.rb +0 -130
  418. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/Changelog.md +0 -292
  419. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/LICENSE.md +0 -23
  420. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/README.md +0 -40
  421. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/caller_filter.rb +0 -83
  422. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/comparable_version.rb +0 -46
  423. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/differ.rb +0 -215
  424. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/directory_maker.rb +0 -63
  425. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/encoded_string.rb +0 -161
  426. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/fuzzy_matcher.rb +0 -48
  427. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/hunk_generator.rb +0 -47
  428. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/matcher_definition.rb +0 -42
  429. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/method_signature_verifier.rb +0 -438
  430. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/mutex.rb +0 -73
  431. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/object_formatter.rb +0 -275
  432. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/recursive_const_methods.rb +0 -76
  433. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/reentrant_mutex.rb +0 -53
  434. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/ruby_features.rb +0 -185
  435. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/source/location.rb +0 -21
  436. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/source/node.rb +0 -110
  437. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/source/token.rb +0 -87
  438. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/source.rb +0 -75
  439. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/deprecation_helpers.rb +0 -64
  440. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/formatting_support.rb +0 -9
  441. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/in_sub_process.rb +0 -69
  442. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/library_wide_checks.rb +0 -150
  443. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/shell_out.rb +0 -89
  444. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/stderr_splitter.rb +0 -67
  445. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/string_matcher.rb +0 -46
  446. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/with_isolated_directory.rb +0 -13
  447. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec/with_isolated_stderr.rb +0 -13
  448. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/spec.rb +0 -81
  449. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/version.rb +0 -7
  450. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/warnings.rb +0 -39
  451. data/vendor/cache/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support.rb +0 -149
  452. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/CHANGELOG.md +0 -42
  453. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/LICENSE.txt +0 -21
  454. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/README.md +0 -117
  455. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/fonts/3d.md +0 -33
  456. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/fonts/block.md +0 -34
  457. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/fonts/doom.md +0 -30
  458. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/fonts/standard.md +0 -27
  459. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/fonts/starwars.md +0 -28
  460. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/fonts/straight.md +0 -20
  461. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/font/result.rb +0 -33
  462. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/font/version.rb +0 -7
  463. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/font.rb +0 -88
  464. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/fonts/3d.yml +0 -1040
  465. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/fonts/block.yml +0 -906
  466. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/fonts/doom.yml +0 -916
  467. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/fonts/standard.yml +0 -769
  468. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/fonts/starwars.yml +0 -862
  469. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/fonts/straight.yml +0 -570
  470. data/vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty-font.rb +0 -1
  471. data/vendor/cache/ruby/2.6.0/specifications/colorize-0.8.1.gemspec +0 -38
  472. data/vendor/cache/ruby/2.6.0/specifications/diff-lcs-1.3.gemspec +0 -61
  473. data/vendor/cache/ruby/2.6.0/specifications/rake-10.5.0.gemspec +0 -43
  474. data/vendor/cache/ruby/2.6.0/specifications/rspec-3.9.0.gemspec +0 -43
  475. data/vendor/cache/ruby/2.6.0/specifications/rspec-core-3.9.1.gemspec +0 -63
  476. data/vendor/cache/ruby/2.6.0/specifications/rspec-expectations-3.9.1.gemspec +0 -51
  477. data/vendor/cache/ruby/2.6.0/specifications/rspec-mocks-3.9.1.gemspec +0 -51
  478. data/vendor/cache/ruby/2.6.0/specifications/rspec-support-3.9.2.gemspec +0 -39
  479. data/vendor/cache/ruby/2.6.0/specifications/tty-font-0.5.0.gemspec +0 -42
@@ -1,2336 +0,0 @@
1
- RSpec::Support.require_rspec_core "backtrace_formatter"
2
- RSpec::Support.require_rspec_core "ruby_project"
3
- RSpec::Support.require_rspec_core "formatters/deprecation_formatter"
4
- RSpec::Support.require_rspec_core "output_wrapper"
5
-
6
- module RSpec
7
- module Core
8
- # rubocop:disable Metrics/ClassLength
9
-
10
- # Stores runtime configuration information.
11
- #
12
- # Configuration options are loaded from multiple files and joined together
13
- # with command-line switches and the `SPEC_OPTS` environment variable.
14
- #
15
- # Precedence order (where later entries overwrite earlier entries on
16
- # conflicts):
17
- #
18
- # * Global (`$XDG_CONFIG_HOME/rspec/options`, or `~/.rspec` if it does
19
- # not exist)
20
- # * Project-specific (`./.rspec`)
21
- # * Local (`./.rspec-local`)
22
- # * Command-line options
23
- # * `SPEC_OPTS`
24
- #
25
- # For example, an option set in the local file will override an option set
26
- # in your global file.
27
- #
28
- # The global, project-specific and local files can all be overridden with a
29
- # separate custom file using the --options command-line parameter.
30
- #
31
- # @example Standard settings
32
- # RSpec.configure do |c|
33
- # c.drb = true
34
- # c.drb_port = 1234
35
- # c.default_path = 'behavior'
36
- # end
37
- #
38
- # @example Hooks
39
- # RSpec.configure do |c|
40
- # c.before(:suite) { establish_connection }
41
- # c.before(:example) { log_in_as :authorized }
42
- # c.around(:example) { |ex| Database.transaction(&ex) }
43
- # end
44
- #
45
- # @see RSpec.configure
46
- # @see Hooks
47
- class Configuration
48
- include RSpec::Core::Hooks
49
-
50
- # Module that holds `attr_reader` declarations. It's in a separate
51
- # module to allow us to override those methods and use `super`.
52
- # @private
53
- Readers = Module.new
54
- include Readers
55
-
56
- # @private
57
- class MustBeConfiguredBeforeExampleGroupsError < StandardError; end
58
-
59
- # @private
60
- def self.define_reader(name)
61
- Readers.class_eval do
62
- remove_method name if method_defined?(name)
63
- attr_reader name
64
- end
65
-
66
- define_method(name) { value_for(name) { super() } }
67
- end
68
-
69
- # @private
70
- def self.define_aliases(name, alias_name)
71
- alias_method alias_name, name
72
- alias_method "#{alias_name}=", "#{name}="
73
- define_predicate_for alias_name
74
- end
75
-
76
- # @private
77
- def self.define_predicate_for(*names)
78
- names.each { |name| alias_method "#{name}?", name }
79
- end
80
-
81
- # @private
82
- #
83
- # Invoked by the `add_setting` instance method. Use that method on a
84
- # `Configuration` instance rather than this class method.
85
- def self.add_setting(name, opts={})
86
- raise "Use the instance add_setting method if you want to set a default" if opts.key?(:default)
87
- attr_writer name
88
- add_read_only_setting name
89
-
90
- Array(opts[:alias_with]).each do |alias_name|
91
- define_aliases(name, alias_name)
92
- end
93
- end
94
-
95
- # @private
96
- #
97
- # As `add_setting` but only add the reader.
98
- def self.add_read_only_setting(name, opts={})
99
- raise "Use the instance add_setting method if you want to set a default" if opts.key?(:default)
100
- define_reader name
101
- define_predicate_for name
102
- end
103
-
104
- # @macro [attach] add_setting
105
- # @!attribute [rw] $1
106
- #
107
- # @macro [attach] define_reader
108
- # @!attribute [r] $1
109
-
110
- # @macro add_setting
111
- # Path to use if no path is provided to the `rspec` command (default:
112
- # `"spec"`). Allows you to just type `rspec` instead of `rspec spec` to
113
- # run all the examples in the `spec` directory.
114
- #
115
- # @note Other scripts invoking `rspec` indirectly will ignore this
116
- # setting.
117
- # @return [String]
118
- add_read_only_setting :default_path
119
- def default_path=(path)
120
- project_source_dirs << path
121
- @default_path = path
122
- end
123
-
124
- # @macro add_setting
125
- # Run examples over DRb (default: `false`). RSpec doesn't supply the DRb
126
- # server, but you can use tools like spork.
127
- # @return [Boolean]
128
- add_setting :drb
129
-
130
- # @macro add_setting
131
- # The drb_port (default: nil).
132
- add_setting :drb_port
133
-
134
- # @macro add_setting
135
- # Default: `$stderr`.
136
- add_setting :error_stream
137
-
138
- # Indicates if the DSL has been exposed off of modules and `main`.
139
- # Default: true
140
- # @return [Boolean]
141
- def expose_dsl_globally?
142
- Core::DSL.exposed_globally?
143
- end
144
-
145
- # Use this to expose the core RSpec DSL via `Module` and the `main`
146
- # object. It will be set automatically but you can override it to
147
- # remove the DSL.
148
- # Default: true
149
- def expose_dsl_globally=(value)
150
- if value
151
- Core::DSL.expose_globally!
152
- Core::SharedExampleGroup::TopLevelDSL.expose_globally!
153
- else
154
- Core::DSL.remove_globally!
155
- Core::SharedExampleGroup::TopLevelDSL.remove_globally!
156
- end
157
- end
158
-
159
- # Determines where deprecation warnings are printed.
160
- # Defaults to `$stderr`.
161
- # @return [IO, String] IO or filename to write to
162
- define_reader :deprecation_stream
163
-
164
- # Determines where deprecation warnings are printed.
165
- # @param value [IO, String] IO to write to or filename to write to
166
- def deprecation_stream=(value)
167
- if @reporter && !value.equal?(@deprecation_stream)
168
- warn "RSpec's reporter has already been initialized with " \
169
- "#{deprecation_stream.inspect} as the deprecation stream, so your change to "\
170
- "`deprecation_stream` will be ignored. You should configure it earlier for " \
171
- "it to take effect, or use the `--deprecation-out` CLI option. " \
172
- "(Called from #{CallerFilter.first_non_rspec_line})"
173
- else
174
- @deprecation_stream = value
175
- end
176
- end
177
-
178
- # @macro define_reader
179
- # The file path to use for persisting example statuses. Necessary for the
180
- # `--only-failures` and `--next-failure` CLI options.
181
- #
182
- # @overload example_status_persistence_file_path
183
- # @return [String] the file path
184
- # @overload example_status_persistence_file_path=(value)
185
- # @param value [String] the file path
186
- define_reader :example_status_persistence_file_path
187
-
188
- # Sets the file path to use for persisting example statuses. Necessary for the
189
- # `--only-failures` and `--next-failure` CLI options.
190
- def example_status_persistence_file_path=(value)
191
- @example_status_persistence_file_path = value
192
- clear_values_derived_from_example_status_persistence_file_path
193
- end
194
-
195
- # @macro define_reader
196
- # Indicates if the `--only-failures` (or `--next-failure`) flag is being used.
197
- define_reader :only_failures
198
- alias_method :only_failures?, :only_failures
199
-
200
- # @private
201
- def only_failures_but_not_configured?
202
- only_failures? && !example_status_persistence_file_path
203
- end
204
-
205
- # @macro define_reader
206
- # If specified, indicates the number of failures required before cleaning
207
- # up and exit (default: `nil`). Can also be `true` to fail and exit on first
208
- # failure
209
- define_reader :fail_fast
210
-
211
- # @see fail_fast
212
- def fail_fast=(value)
213
- case value
214
- when true, 'true'
215
- @fail_fast = true
216
- when false, 'false', 0
217
- @fail_fast = false
218
- when nil
219
- @fail_fast = nil
220
- else
221
- @fail_fast = value.to_i
222
-
223
- if value.to_i == 0
224
- # TODO: in RSpec 4, consider raising an error here.
225
- RSpec.warning "Cannot set `RSpec.configuration.fail_fast`" \
226
- " to `#{value.inspect}`. Only `true`, `false`, `nil` and integers" \
227
- " are valid values."
228
- @fail_fast = true
229
- end
230
- end
231
- end
232
-
233
- # @macro add_setting
234
- # Prints the formatter output of your suite without running any
235
- # examples or hooks.
236
- add_setting :dry_run
237
-
238
- # @macro add_setting
239
- # The exit code to return if there are any failures (default: 1).
240
- # @return [Integer]
241
- add_setting :failure_exit_code
242
-
243
- # @macro add_setting
244
- # Whether or not to fail when there are no RSpec examples (default: false).
245
- # @return [Boolean]
246
- add_setting :fail_if_no_examples
247
-
248
- # @macro define_reader
249
- # Indicates files configured to be required.
250
- # @return [Array<String>]
251
- define_reader :requires
252
-
253
- # @macro define_reader
254
- # Returns dirs that have been prepended to the load path by the `-I`
255
- # command line option.
256
- # @return [Array<String>]
257
- define_reader :libs
258
-
259
- # @macro add_setting
260
- # Determines where RSpec will send its output.
261
- # Default: `$stdout`.
262
- # @return [IO, String]
263
- define_reader :output_stream
264
-
265
- # Set the output stream for reporter.
266
- # @attr value [IO, String] IO to write to or filename to write to, defaults to $stdout
267
- def output_stream=(value)
268
- if @reporter && !value.equal?(@output_stream)
269
- warn "RSpec's reporter has already been initialized with " \
270
- "#{output_stream.inspect} as the output stream, so your change to "\
271
- "`output_stream` will be ignored. You should configure it earlier for " \
272
- "it to take effect. (Called from #{CallerFilter.first_non_rspec_line})"
273
- else
274
- @output_stream = value
275
- output_wrapper.output = @output_stream
276
- end
277
- end
278
-
279
- # @macro define_reader
280
- # Load files matching this pattern (default: `'**{,/*/**}/*_spec.rb'`).
281
- # @return [String]
282
- define_reader :pattern
283
-
284
- # Set pattern to match files to load.
285
- # @attr value [String] the filename pattern to filter spec files by
286
- def pattern=(value)
287
- update_pattern_attr :pattern, value
288
- end
289
-
290
- # @macro define_reader
291
- # Exclude files matching this pattern.
292
- # @return [String]
293
- define_reader :exclude_pattern
294
-
295
- # Set pattern to match files to exclude.
296
- # @attr value [String] the filename pattern to exclude spec files by
297
- def exclude_pattern=(value)
298
- update_pattern_attr :exclude_pattern, value
299
- end
300
-
301
- # @macro add_setting
302
- # Specifies which directories contain the source code for your project.
303
- # When a failure occurs, RSpec looks through the backtrace to find a
304
- # a line of source to print. It first looks for a line coming from
305
- # one of the project source directories so that, for example, it prints
306
- # the expectation or assertion call rather than the source code from
307
- # the expectation or assertion framework.
308
- # @return [Array<String>]
309
- add_setting :project_source_dirs
310
-
311
- # @macro add_setting
312
- # Report the times for the slowest examples (default: `false`).
313
- # Use this to specify the number of examples to include in the profile.
314
- # @return [Boolean]
315
- add_setting :profile_examples
316
-
317
- # @macro add_setting
318
- # Run all examples if none match the configured filters
319
- # (default: `false`).
320
- # @deprecated Use {#filter_run_when_matching} instead for the specific
321
- # filters that you want to be ignored if none match.
322
- add_setting :run_all_when_everything_filtered
323
-
324
- # @macro add_setting
325
- # Color to use to indicate success. Defaults to `:green` but can be set
326
- # to one of the following: `[:black, :white, :red, :green, :yellow,
327
- # :blue, :magenta, :cyan]`
328
- # @return [Symbol]
329
- add_setting :success_color
330
-
331
- # @macro add_setting
332
- # Color to use to print pending examples. Defaults to `:yellow` but can
333
- # be set to one of the following: `[:black, :white, :red, :green,
334
- # :yellow, :blue, :magenta, :cyan]`
335
- # @return [Symbol]
336
- add_setting :pending_color
337
-
338
- # @macro add_setting
339
- # Color to use to indicate failure. Defaults to `:red` but can be set to
340
- # one of the following: `[:black, :white, :red, :green, :yellow, :blue,
341
- # :magenta, :cyan]`
342
- # @return [Symbol]
343
- add_setting :failure_color
344
-
345
- # @macro add_setting
346
- # The default output color. Defaults to `:white` but can be set to one of
347
- # the following: `[:black, :white, :red, :green, :yellow, :blue,
348
- # :magenta, :cyan]`
349
- # @return [Symbol]
350
- add_setting :default_color
351
-
352
- # @macro add_setting
353
- # Color used when a pending example is fixed. Defaults to `:blue` but can
354
- # be set to one of the following: `[:black, :white, :red, :green,
355
- # :yellow, :blue, :magenta, :cyan]`
356
- # @return [Symbol]
357
- add_setting :fixed_color
358
-
359
- # @macro add_setting
360
- # Color used to print details. Defaults to `:cyan` but can be set to one
361
- # of the following: `[:black, :white, :red, :green, :yellow, :blue,
362
- # :magenta, :cyan]`
363
- # @return [Symbol]
364
- add_setting :detail_color
365
-
366
- # @macro add_setting
367
- # Don't print filter info i.e. "Run options: include {:focus=>true}"
368
- # (default `false`).
369
- # return [Boolean]
370
- add_setting :silence_filter_announcements
371
-
372
- # @deprecated This config option was added in RSpec 2 to pave the way
373
- # for this being the default behavior in RSpec 3. Now this option is
374
- # a no-op.
375
- def treat_symbols_as_metadata_keys_with_true_values=(_value)
376
- RSpec.deprecate(
377
- "RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values=",
378
- :message => "RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values= " \
379
- "is deprecated, it is now set to true as default and " \
380
- "setting it to false has no effect."
381
- )
382
- end
383
-
384
- # @macro define_reader
385
- # Configures how RSpec treats metadata passed as part of a shared example
386
- # group definition. For example, given this shared example group definition:
387
- #
388
- # RSpec.shared_context "uses DB", :db => true do
389
- # around(:example) do |ex|
390
- # MyORM.transaction(:rollback => true, &ex)
391
- # end
392
- # end
393
- #
394
- # ...there are two ways RSpec can treat the `:db => true` metadata, each
395
- # of which has a corresponding config option:
396
- #
397
- # 1. `:trigger_inclusion`: this shared context will be implicitly included
398
- # in any groups (or examples) that have `:db => true` metadata.
399
- # 2. `:apply_to_host_groups`: the metadata will be inherited by the metadata
400
- # hash of all host groups and examples.
401
- #
402
- # `:trigger_inclusion` is the legacy behavior from before RSpec 3.5 but should
403
- # be considered deprecated. Instead, you can explicitly include a group with
404
- # `include_context`:
405
- #
406
- # RSpec.describe "My model" do
407
- # include_context "uses DB"
408
- # end
409
- #
410
- # ...or you can configure RSpec to include the context based on matching metadata
411
- # using an API that mirrors configured module inclusion:
412
- #
413
- # RSpec.configure do |rspec|
414
- # rspec.include_context "uses DB", :db => true
415
- # end
416
- #
417
- # `:apply_to_host_groups` is a new feature of RSpec 3.5 and will be the only
418
- # supported behavior in RSpec 4.
419
- #
420
- # @overload shared_context_metadata_behavior
421
- # @return [:trigger_inclusion, :apply_to_host_groups] the configured behavior
422
- # @overload shared_context_metadata_behavior=(value)
423
- # @param value [:trigger_inclusion, :apply_to_host_groups] sets the configured behavior
424
- define_reader :shared_context_metadata_behavior
425
- # @see shared_context_metadata_behavior
426
- def shared_context_metadata_behavior=(value)
427
- case value
428
- when :trigger_inclusion, :apply_to_host_groups
429
- @shared_context_metadata_behavior = value
430
- else
431
- raise ArgumentError, "Cannot set `RSpec.configuration." \
432
- "shared_context_metadata_behavior` to `#{value.inspect}`. Only " \
433
- "`:trigger_inclusion` and `:apply_to_host_groups` are valid values."
434
- end
435
- end
436
-
437
- # Record the start time of the spec suite to measure load time.
438
- # return [Time]
439
- add_setting :start_time
440
-
441
- # @macro add_setting
442
- # Use threadsafe options where available.
443
- # Currently this will place a mutex around memoized values such as let blocks.
444
- # return [Boolean]
445
- add_setting :threadsafe
446
-
447
- # @macro add_setting
448
- # Maximum count of failed source lines to display in the failure reports.
449
- # (default `10`).
450
- # return [Integer]
451
- add_setting :max_displayed_failure_line_count
452
-
453
- # Determines which bisect runner implementation gets used to run subsets
454
- # of the suite during a bisection. Your choices are:
455
- #
456
- # - `:shell`: Performs a spec run by shelling out, booting RSpec and your
457
- # application environment each time. This runner is the most widely
458
- # compatible runner, but is not as fast. On platforms that do not
459
- # support forking, this is the default.
460
- # - `:fork`: Pre-boots RSpec and your application environment in a parent
461
- # process, and then forks a child process for each spec run. This runner
462
- # tends to be significantly faster than the `:shell` runner but cannot
463
- # be used in some situations. On platforms that support forking, this
464
- # is the default. If you use this runner, you should ensure that all
465
- # of your one-time setup logic goes in a `before(:suite)` hook instead
466
- # of getting run at the top-level of a file loaded by `--require`.
467
- #
468
- # @note This option will only be used by `--bisect` if you set it in a file
469
- # loaded via `--require`.
470
- #
471
- # @return [Symbol]
472
- attr_reader :bisect_runner
473
- def bisect_runner=(value)
474
- if @bisect_runner_class && value != @bisect_runner
475
- raise "`config.bisect_runner = #{value.inspect}` can no longer take " \
476
- "effect as the #{@bisect_runner.inspect} bisect runnner is already " \
477
- "in use. This config setting must be set in a file loaded by a " \
478
- "`--require` option (passed at the CLI or in a `.rspec` file) for " \
479
- "it to have any effect."
480
- end
481
-
482
- @bisect_runner = value
483
- end
484
-
485
- # @private
486
- # @deprecated Use {#color_mode} = :on, instead of {#color} with {#tty}
487
- add_setting :tty
488
- # @private
489
- attr_writer :files_to_run
490
- # @private
491
- attr_accessor :filter_manager, :world
492
- # @private
493
- attr_accessor :static_config_filter_manager
494
- # @private
495
- attr_reader :backtrace_formatter, :ordering_manager, :loaded_spec_files
496
-
497
- # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
498
-
499
- # Build an object to store runtime configuration options and set defaults
500
- def initialize
501
- # rubocop:disable Style/GlobalVars
502
- @start_time = $_rspec_core_load_started_at || ::RSpec::Core::Time.now
503
- # rubocop:enable Style/GlobalVars
504
- @expectation_frameworks = []
505
- @include_modules = FilterableItemRepository::QueryOptimized.new(:any?)
506
- @extend_modules = FilterableItemRepository::QueryOptimized.new(:any?)
507
- @prepend_modules = FilterableItemRepository::QueryOptimized.new(:any?)
508
-
509
- @bisect_runner = RSpec::Support::RubyFeatures.fork_supported? ? :fork : :shell
510
- @bisect_runner_class = nil
511
-
512
- @before_suite_hooks = []
513
- @after_suite_hooks = []
514
-
515
- @mock_framework = nil
516
- @files_or_directories_to_run = []
517
- @loaded_spec_files = Set.new
518
- @color = false
519
- @color_mode = :automatic
520
- @pattern = '**{,/*/**}/*_spec.rb'
521
- @exclude_pattern = ''
522
- @failure_exit_code = 1
523
- @fail_if_no_examples = false
524
- @spec_files_loaded = false
525
-
526
- @backtrace_formatter = BacktraceFormatter.new
527
-
528
- @default_path = 'spec'
529
- @project_source_dirs = %w[ spec lib app ]
530
- @deprecation_stream = $stderr
531
- @output_stream = $stdout
532
- @reporter = nil
533
- @reporter_buffer = nil
534
- @filter_manager = FilterManager.new
535
- @static_config_filter_manager = FilterManager.new
536
- @ordering_manager = Ordering::ConfigurationManager.new
537
- @preferred_options = {}
538
- @failure_color = :red
539
- @success_color = :green
540
- @pending_color = :yellow
541
- @default_color = :white
542
- @fixed_color = :blue
543
- @detail_color = :cyan
544
- @profile_examples = false
545
- @requires = []
546
- @libs = []
547
- @derived_metadata_blocks = FilterableItemRepository::QueryOptimized.new(:any?)
548
- @threadsafe = true
549
- @max_displayed_failure_line_count = 10
550
- @world = World::Null
551
- @shared_context_metadata_behavior = :trigger_inclusion
552
-
553
- define_built_in_hooks
554
- end
555
- # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
556
-
557
- # @private
558
- #
559
- # Used to set higher priority option values from the command line.
560
- def force(hash)
561
- ordering_manager.force(hash)
562
- @preferred_options.merge!(hash)
563
-
564
- return unless hash.key?(:example_status_persistence_file_path)
565
- clear_values_derived_from_example_status_persistence_file_path
566
- end
567
-
568
- # @private
569
- def reset
570
- @spec_files_loaded = false
571
- reset_reporter
572
- end
573
-
574
- # @private
575
- def reset_reporter
576
- @reporter = nil
577
- @formatter_loader = nil
578
- @output_wrapper = nil
579
- end
580
-
581
- # @private
582
- def reset_filters
583
- self.filter_manager = FilterManager.new
584
- filter_manager.include_only(
585
- Metadata.deep_hash_dup(static_config_filter_manager.inclusions.rules)
586
- )
587
- filter_manager.exclude_only(
588
- Metadata.deep_hash_dup(static_config_filter_manager.exclusions.rules)
589
- )
590
- end
591
-
592
- # @overload add_setting(name)
593
- # @overload add_setting(name, opts)
594
- # @option opts [Symbol] :default
595
- #
596
- # Set a default value for the generated getter and predicate methods:
597
- #
598
- # add_setting(:foo, :default => "default value")
599
- #
600
- # @option opts [Symbol] :alias_with
601
- #
602
- # Use `:alias_with` to alias the setter, getter, and predicate to
603
- # another name, or names:
604
- #
605
- # add_setting(:foo, :alias_with => :bar)
606
- # add_setting(:foo, :alias_with => [:bar, :baz])
607
- #
608
- # Adds a custom setting to the RSpec.configuration object.
609
- #
610
- # RSpec.configuration.add_setting :foo
611
- #
612
- # Used internally and by extension frameworks like rspec-rails, so they
613
- # can add config settings that are domain specific. For example:
614
- #
615
- # RSpec.configure do |c|
616
- # c.add_setting :use_transactional_fixtures,
617
- # :default => true,
618
- # :alias_with => :use_transactional_examples
619
- # end
620
- #
621
- # `add_setting` creates three methods on the configuration object, a
622
- # setter, a getter, and a predicate:
623
- #
624
- # RSpec.configuration.foo=(value)
625
- # RSpec.configuration.foo
626
- # RSpec.configuration.foo? # Returns true if foo returns anything but nil or false.
627
- def add_setting(name, opts={})
628
- default = opts.delete(:default)
629
- (class << self; self; end).class_exec do
630
- add_setting(name, opts)
631
- end
632
- __send__("#{name}=", default) if default
633
- end
634
-
635
- # Returns the configured mock framework adapter module.
636
- # @return [Symbol]
637
- def mock_framework
638
- if @mock_framework.nil?
639
- begin
640
- mock_with :rspec
641
- rescue LoadError
642
- mock_with :nothing
643
- end
644
- end
645
- @mock_framework
646
- end
647
-
648
- # Delegates to mock_framework=(framework).
649
- def mock_framework=(framework)
650
- mock_with framework
651
- end
652
-
653
- # Regexps used to exclude lines from backtraces.
654
- #
655
- # Excludes lines from ruby (and jruby) source, installed gems, anything
656
- # in any "bin" directory, and any of the RSpec libs (outside gem
657
- # installs) by default.
658
- #
659
- # You can modify the list via the getter, or replace it with the setter.
660
- #
661
- # To override this behaviour and display a full backtrace, use
662
- # `--backtrace` on the command line, in a `.rspec` file, or in the
663
- # `rspec_options` attribute of RSpec's rake task.
664
- # @return [Array<Regexp>]
665
- def backtrace_exclusion_patterns
666
- @backtrace_formatter.exclusion_patterns
667
- end
668
-
669
- # Set regular expressions used to exclude lines in backtrace.
670
- # @param patterns [Array<Regexp>] set backtrace_formatter exlusion_patterns
671
- def backtrace_exclusion_patterns=(patterns)
672
- @backtrace_formatter.exclusion_patterns = patterns
673
- end
674
-
675
- # Regexps used to include lines in backtraces.
676
- #
677
- # Defaults to [Regexp.new Dir.getwd].
678
- #
679
- # Lines that match an exclusion _and_ an inclusion pattern
680
- # will be included.
681
- #
682
- # You can modify the list via the getter, or replace it with the setter.
683
- # @return [Array<Regexp>]
684
- def backtrace_inclusion_patterns
685
- @backtrace_formatter.inclusion_patterns
686
- end
687
-
688
- # Set regular expressions used to include lines in backtrace.
689
- # @attr patterns [Array<Regexp>] set backtrace_formatter inclusion_patterns
690
- def backtrace_inclusion_patterns=(patterns)
691
- @backtrace_formatter.inclusion_patterns = patterns
692
- end
693
-
694
- # Adds {#backtrace_exclusion_patterns} that will filter lines from
695
- # the named gems from backtraces.
696
- #
697
- # @param gem_names [Array<String>] Names of the gems to filter
698
- #
699
- # @example
700
- # RSpec.configure do |config|
701
- # config.filter_gems_from_backtrace "rack", "rake"
702
- # end
703
- #
704
- # @note The patterns this adds will match the named gems in their common
705
- # locations (e.g. system gems, vendored with bundler, installed as a
706
- # :git dependency with bundler, etc) but is not guaranteed to work for
707
- # all possible gem locations. For example, if you have the gem source
708
- # in a directory with a completely unrelated name, and use bundler's
709
- # :path option, this will not filter it.
710
- def filter_gems_from_backtrace(*gem_names)
711
- gem_names.each do |name|
712
- @backtrace_formatter.filter_gem(name)
713
- end
714
- end
715
-
716
- # @private
717
- MOCKING_ADAPTERS = {
718
- :rspec => :RSpec,
719
- :flexmock => :Flexmock,
720
- :rr => :RR,
721
- :mocha => :Mocha,
722
- :nothing => :Null
723
- }
724
-
725
- # Sets the mock framework adapter module.
726
- #
727
- # `framework` can be a Symbol or a Module.
728
- #
729
- # Given any of `:rspec`, `:mocha`, `:flexmock`, or `:rr`, configures the
730
- # named framework.
731
- #
732
- # Given `:nothing`, configures no framework. Use this if you don't use
733
- # any mocking framework to save a little bit of overhead.
734
- #
735
- # Given a Module, includes that module in every example group. The module
736
- # should adhere to RSpec's mock framework adapter API:
737
- #
738
- # setup_mocks_for_rspec
739
- # - called before each example
740
- #
741
- # verify_mocks_for_rspec
742
- # - called after each example if the example hasn't yet failed.
743
- # Framework should raise an exception when expectations fail
744
- #
745
- # teardown_mocks_for_rspec
746
- # - called after verify_mocks_for_rspec (even if there are errors)
747
- #
748
- # If the module responds to `configuration` and `mock_with` receives a
749
- # block, it will yield the configuration object to the block e.g.
750
- #
751
- # config.mock_with OtherMockFrameworkAdapter do |mod_config|
752
- # mod_config.custom_setting = true
753
- # end
754
- def mock_with(framework)
755
- framework_module =
756
- if framework.is_a?(Module)
757
- framework
758
- else
759
- const_name = MOCKING_ADAPTERS.fetch(framework) do
760
- raise ArgumentError,
761
- "Unknown mocking framework: #{framework.inspect}. " \
762
- "Pass a module or one of #{MOCKING_ADAPTERS.keys.inspect}"
763
- end
764
-
765
- RSpec::Support.require_rspec_core "mocking_adapters/#{const_name.to_s.downcase}"
766
- RSpec::Core::MockingAdapters.const_get(const_name)
767
- end
768
-
769
- new_name, old_name = [framework_module, @mock_framework].map do |mod|
770
- mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed
771
- end
772
-
773
- unless new_name == old_name
774
- assert_no_example_groups_defined(:mock_framework)
775
- end
776
-
777
- if block_given?
778
- raise "#{framework_module} must respond to `configuration` so that " \
779
- "mock_with can yield it." unless framework_module.respond_to?(:configuration)
780
- yield framework_module.configuration
781
- end
782
-
783
- @mock_framework = framework_module
784
- end
785
-
786
- # Returns the configured expectation framework adapter module(s)
787
- def expectation_frameworks
788
- if @expectation_frameworks.empty?
789
- begin
790
- expect_with :rspec
791
- rescue LoadError
792
- expect_with Module.new
793
- end
794
- end
795
- @expectation_frameworks
796
- end
797
-
798
- # Delegates to expect_with(framework).
799
- def expectation_framework=(framework)
800
- expect_with(framework)
801
- end
802
-
803
- # Sets the expectation framework module(s) to be included in each example
804
- # group.
805
- #
806
- # `frameworks` can be `:rspec`, `:test_unit`, `:minitest`, a custom
807
- # module, or any combination thereof:
808
- #
809
- # config.expect_with :rspec
810
- # config.expect_with :test_unit
811
- # config.expect_with :minitest
812
- # config.expect_with :rspec, :minitest
813
- # config.expect_with OtherExpectationFramework
814
- #
815
- # RSpec will translate `:rspec`, `:minitest`, and `:test_unit` into the
816
- # appropriate modules.
817
- #
818
- # ## Configuration
819
- #
820
- # If the module responds to `configuration`, `expect_with` will
821
- # yield the `configuration` object if given a block:
822
- #
823
- # config.expect_with OtherExpectationFramework do |custom_config|
824
- # custom_config.custom_setting = true
825
- # end
826
- def expect_with(*frameworks)
827
- modules = frameworks.map do |framework|
828
- case framework
829
- when Module
830
- framework
831
- when :rspec
832
- require 'rspec/expectations'
833
-
834
- # Tag this exception class so our exception formatting logic knows
835
- # that it satisfies the `MultipleExceptionError` interface.
836
- ::RSpec::Expectations::MultipleExpectationsNotMetError.__send__(
837
- :include, MultipleExceptionError::InterfaceTag
838
- )
839
-
840
- ::RSpec::Matchers
841
- when :test_unit
842
- require 'rspec/core/test_unit_assertions_adapter'
843
- ::RSpec::Core::TestUnitAssertionsAdapter
844
- when :minitest
845
- require 'rspec/core/minitest_assertions_adapter'
846
- ::RSpec::Core::MinitestAssertionsAdapter
847
- else
848
- raise ArgumentError, "#{framework.inspect} is not supported"
849
- end
850
- end
851
-
852
- if (modules - @expectation_frameworks).any?
853
- assert_no_example_groups_defined(:expect_with)
854
- end
855
-
856
- if block_given?
857
- raise "expect_with only accepts a block with a single argument. " \
858
- "Call expect_with #{modules.length} times, " \
859
- "once with each argument, instead." if modules.length > 1
860
- raise "#{modules.first} must respond to `configuration` so that " \
861
- "expect_with can yield it." unless modules.first.respond_to?(:configuration)
862
- yield modules.first.configuration
863
- end
864
-
865
- @expectation_frameworks.push(*modules)
866
- end
867
-
868
- # Check if full backtrace is enabled.
869
- # @return [Boolean] is full backtrace enabled
870
- def full_backtrace?
871
- @backtrace_formatter.full_backtrace?
872
- end
873
-
874
- # Toggle full backtrace.
875
- # @attr true_or_false [Boolean] toggle full backtrace display
876
- def full_backtrace=(true_or_false)
877
- @backtrace_formatter.full_backtrace = true_or_false
878
- end
879
-
880
- # Enables color output if the output is a TTY. As of RSpec 3.6, this is
881
- # the default behavior and this option is retained only for backwards
882
- # compatibility.
883
- #
884
- # @deprecated No longer recommended because of complex behavior. Instead,
885
- # rely on the fact that TTYs will display color by default, or set
886
- # {#color_mode} to :on to display color on a non-TTY output.
887
- # @see color_mode
888
- # @see color_enabled?
889
- # @return [Boolean]
890
- def color
891
- value_for(:color) { @color }
892
- end
893
-
894
- # The mode for determining whether to display output in color. One of:
895
- #
896
- # - :automatic - the output will be in color if the output is a TTY (the
897
- # default)
898
- # - :on - the output will be in color, whether or not the output is a TTY
899
- # - :off - the output will not be in color
900
- #
901
- # @see color_enabled?
902
- # @return [Boolean]
903
- def color_mode
904
- value_for(:color_mode) { @color_mode }
905
- end
906
-
907
- # Check if color is enabled for a particular output.
908
- # @param output [IO] an output stream to use, defaults to the current
909
- # `output_stream`
910
- # @return [Boolean]
911
- def color_enabled?(output=output_stream)
912
- case color_mode
913
- when :on then true
914
- when :off then false
915
- else # automatic
916
- output_to_tty?(output) || (color && tty?)
917
- end
918
- end
919
-
920
- # Set the color mode.
921
- attr_writer :color_mode
922
-
923
- # Toggle output color.
924
- #
925
- # @deprecated No longer recommended because of complex behavior. Instead,
926
- # rely on the fact that TTYs will display color by default, or set
927
- # {:color_mode} to :on to display color on a non-TTY output.
928
- attr_writer :color
929
-
930
- # @private
931
- def libs=(libs)
932
- libs.map do |lib|
933
- @libs.unshift lib
934
- $LOAD_PATH.unshift lib
935
- end
936
- end
937
-
938
- # Run examples matching on `description` in all files to run.
939
- # @param description [String, Regexp] the pattern to filter on
940
- def full_description=(description)
941
- filter_run :full_description => Regexp.union(*Array(description).map { |d| Regexp.new(d) })
942
- end
943
-
944
- # @return [Array] full description filter
945
- def full_description
946
- filter.fetch :full_description, nil
947
- end
948
-
949
- # @overload add_formatter(formatter)
950
- # @overload add_formatter(formatter, output)
951
- #
952
- # @param formatter [Class, String, Object] formatter to use. Can be any of the
953
- # string values supported from the CLI (`p`/`progress`,
954
- # `d`/`doc`/`documentation`, `h`/`html`, or `j`/`json`), any
955
- # class that implements the formatter protocol and has registered
956
- # itself with RSpec as a formatter, or a formatter instance.
957
- # @param output [String, IO] where the formatter will write its output.
958
- # Can be an IO object or a string path to a file. If not provided,
959
- # the configured `output_stream` (`$stdout`, by default) will be used.
960
- #
961
- # Adds a formatter to the set RSpec will use for this run.
962
- #
963
- # @see RSpec::Core::Formatters::Protocol
964
- def add_formatter(formatter, output=output_wrapper)
965
- formatter_loader.add(formatter, output)
966
- end
967
- alias_method :formatter=, :add_formatter
968
-
969
- # The formatter that will be used if no formatter has been set.
970
- # Defaults to 'progress'.
971
- def default_formatter
972
- formatter_loader.default_formatter
973
- end
974
-
975
- # Sets a fallback formatter to use if none other has been set.
976
- #
977
- # @example
978
- #
979
- # RSpec.configure do |rspec|
980
- # rspec.default_formatter = 'doc'
981
- # end
982
- def default_formatter=(value)
983
- formatter_loader.default_formatter = value
984
- end
985
-
986
- # Returns a duplicate of the formatters currently loaded in
987
- # the `FormatterLoader` for introspection.
988
- #
989
- # Note as this is a duplicate, any mutations will be disregarded.
990
- #
991
- # @return [Array] the formatters currently loaded
992
- def formatters
993
- formatter_loader.formatters.dup
994
- end
995
-
996
- # @private
997
- def formatter_loader
998
- @formatter_loader ||= Formatters::Loader.new(Reporter.new(self))
999
- end
1000
-
1001
- # @private
1002
- #
1003
- # This buffer is used to capture all messages sent to the reporter during
1004
- # reporter initialization. It can then replay those messages after the
1005
- # formatter is correctly initialized. Otherwise, deprecation warnings
1006
- # during formatter initialization can cause an infinite loop.
1007
- class DeprecationReporterBuffer
1008
- def initialize
1009
- @calls = []
1010
- end
1011
-
1012
- def deprecation(*args)
1013
- @calls << args
1014
- end
1015
-
1016
- def play_onto(reporter)
1017
- @calls.each do |args|
1018
- reporter.deprecation(*args)
1019
- end
1020
- end
1021
- end
1022
-
1023
- # @return [RSpec::Core::Reporter] the currently configured reporter
1024
- def reporter
1025
- # @reporter_buffer should only ever be set in this method to cover
1026
- # initialization of @reporter.
1027
- @reporter_buffer || @reporter ||=
1028
- begin
1029
- @reporter_buffer = DeprecationReporterBuffer.new
1030
- formatter_loader.prepare_default output_wrapper, deprecation_stream
1031
- @reporter_buffer.play_onto(formatter_loader.reporter)
1032
- @reporter_buffer = nil
1033
- formatter_loader.reporter
1034
- end
1035
- end
1036
-
1037
- # @api private
1038
- #
1039
- # Defaults `profile_examples` to 10 examples when `@profile_examples` is
1040
- # `true`.
1041
- def profile_examples
1042
- profile = value_for(:profile_examples) { @profile_examples }
1043
- if profile && !profile.is_a?(Integer)
1044
- 10
1045
- else
1046
- profile
1047
- end
1048
- end
1049
-
1050
- # @private
1051
- def files_or_directories_to_run=(*files)
1052
- files = files.flatten
1053
-
1054
- if (command == 'rspec' || Runner.running_in_drb?) && default_path && files.empty?
1055
- files << default_path
1056
- end
1057
-
1058
- @files_or_directories_to_run = files
1059
- @files_to_run = nil
1060
- end
1061
-
1062
- # The spec files RSpec will run.
1063
- # @return [Array] specified files about to run
1064
- def files_to_run
1065
- @files_to_run ||= get_files_to_run(@files_or_directories_to_run)
1066
- end
1067
-
1068
- # @private
1069
- def last_run_statuses
1070
- @last_run_statuses ||= Hash.new(UNKNOWN_STATUS).tap do |statuses|
1071
- if (path = example_status_persistence_file_path)
1072
- begin
1073
- ExampleStatusPersister.load_from(path).inject(statuses) do |hash, example|
1074
- status = example[:status]
1075
- status = UNKNOWN_STATUS unless VALID_STATUSES.include?(status)
1076
- hash[example.fetch(:example_id)] = status
1077
- hash
1078
- end
1079
- rescue SystemCallError => e
1080
- RSpec.warning "Could not read from #{path.inspect} (configured as " \
1081
- "`config.example_status_persistence_file_path`) due " \
1082
- "to a system error: #{e.inspect}. Please check that " \
1083
- "the config option is set to an accessible, valid " \
1084
- "file path", :call_site => nil
1085
- end
1086
- end
1087
- end
1088
- end
1089
-
1090
- # @private
1091
- UNKNOWN_STATUS = "unknown".freeze
1092
-
1093
- # @private
1094
- FAILED_STATUS = "failed".freeze
1095
-
1096
- # @private
1097
- PASSED_STATUS = "passed".freeze
1098
-
1099
- # @private
1100
- PENDING_STATUS = "pending".freeze
1101
-
1102
- # @private
1103
- VALID_STATUSES = [UNKNOWN_STATUS, FAILED_STATUS, PASSED_STATUS, PENDING_STATUS]
1104
-
1105
- # @private
1106
- def spec_files_with_failures
1107
- @spec_files_with_failures ||= last_run_statuses.inject(Set.new) do |files, (id, status)|
1108
- files << Example.parse_id(id).first if status == FAILED_STATUS
1109
- files
1110
- end.to_a
1111
- end
1112
-
1113
- # Creates a method that delegates to `example` including the submitted
1114
- # `args`. Used internally to add variants of `example` like `pending`:
1115
- # @param name [String] example name alias
1116
- # @param args [Array<Symbol>, Hash] metadata for the generated example
1117
- #
1118
- # @note The specific example alias below (`pending`) is already
1119
- # defined for you.
1120
- # @note Use with caution. This extends the language used in your
1121
- # specs, but does not add any additional documentation. We use this
1122
- # in RSpec to define methods like `focus` and `xit`, but we also add
1123
- # docs for those methods.
1124
- #
1125
- # @example
1126
- # RSpec.configure do |config|
1127
- # config.alias_example_to :pending, :pending => true
1128
- # end
1129
- #
1130
- # # This lets you do this:
1131
- #
1132
- # RSpec.describe Thing do
1133
- # pending "does something" do
1134
- # thing = Thing.new
1135
- # end
1136
- # end
1137
- #
1138
- # # ... which is the equivalent of
1139
- #
1140
- # RSpec.describe Thing do
1141
- # it "does something", :pending => true do
1142
- # thing = Thing.new
1143
- # end
1144
- # end
1145
- def alias_example_to(name, *args)
1146
- extra_options = Metadata.build_hash_from(args)
1147
- RSpec::Core::ExampleGroup.define_example_method(name, extra_options)
1148
- end
1149
-
1150
- # Creates a method that defines an example group with the provided
1151
- # metadata. Can be used to define example group/metadata shortcuts.
1152
- #
1153
- # @example
1154
- # RSpec.configure do |config|
1155
- # config.alias_example_group_to :describe_model, :type => :model
1156
- # end
1157
- #
1158
- # shared_context_for "model tests", :type => :model do
1159
- # # define common model test helper methods, `let` declarations, etc
1160
- # end
1161
- #
1162
- # # This lets you do this:
1163
- #
1164
- # RSpec.describe_model User do
1165
- # end
1166
- #
1167
- # # ... which is the equivalent of
1168
- #
1169
- # RSpec.describe User, :type => :model do
1170
- # end
1171
- #
1172
- # @note The defined aliased will also be added to the top level
1173
- # (e.g. `main` and from within modules) if
1174
- # `expose_dsl_globally` is set to true.
1175
- # @see #alias_example_to
1176
- # @see #expose_dsl_globally=
1177
- def alias_example_group_to(new_name, *args)
1178
- extra_options = Metadata.build_hash_from(args)
1179
- RSpec::Core::ExampleGroup.define_example_group_method(new_name, extra_options)
1180
- end
1181
-
1182
- # Define an alias for it_should_behave_like that allows different
1183
- # language (like "it_has_behavior" or "it_behaves_like") to be
1184
- # employed when including shared examples.
1185
- #
1186
- # @example
1187
- # RSpec.configure do |config|
1188
- # config.alias_it_behaves_like_to(:it_has_behavior, 'has behavior:')
1189
- # end
1190
- #
1191
- # # allows the user to include a shared example group like:
1192
- #
1193
- # RSpec.describe Entity do
1194
- # it_has_behavior 'sortability' do
1195
- # let(:sortable) { Entity.new }
1196
- # end
1197
- # end
1198
- #
1199
- # # which is reported in the output as:
1200
- # # Entity
1201
- # # has behavior: sortability
1202
- # # ...sortability examples here
1203
- #
1204
- # @note Use with caution. This extends the language used in your
1205
- # specs, but does not add any additional documentation. We use this
1206
- # in RSpec to define `it_should_behave_like` (for backward
1207
- # compatibility), but we also add docs for that method.
1208
- def alias_it_behaves_like_to(new_name, report_label='')
1209
- RSpec::Core::ExampleGroup.define_nested_shared_group_method(new_name, report_label)
1210
- end
1211
- alias_method :alias_it_should_behave_like_to, :alias_it_behaves_like_to
1212
-
1213
- # Adds key/value pairs to the `inclusion_filter`. If `args`
1214
- # includes any symbols that are not part of the hash, each symbol
1215
- # is treated as a key in the hash with the value `true`.
1216
- #
1217
- # ### Note
1218
- #
1219
- # Filters set using this method can be overridden from the command line
1220
- # or config files (e.g. `.rspec`).
1221
- #
1222
- # @example
1223
- # # Given this declaration.
1224
- # describe "something", :foo => 'bar' do
1225
- # # ...
1226
- # end
1227
- #
1228
- # # Any of the following will include that group.
1229
- # config.filter_run_including :foo => 'bar'
1230
- # config.filter_run_including :foo => /^ba/
1231
- # config.filter_run_including :foo => lambda {|v| v == 'bar'}
1232
- # config.filter_run_including :foo => lambda {|v,m| m[:foo] == 'bar'}
1233
- #
1234
- # # Given a proc with an arity of 1, the lambda is passed the value
1235
- # # related to the key, e.g.
1236
- # config.filter_run_including :foo => lambda {|v| v == 'bar'}
1237
- #
1238
- # # Given a proc with an arity of 2, the lambda is passed the value
1239
- # # related to the key, and the metadata itself e.g.
1240
- # config.filter_run_including :foo => lambda {|v,m| m[:foo] == 'bar'}
1241
- #
1242
- # filter_run_including :foo # same as filter_run_including :foo => true
1243
- def filter_run_including(*args)
1244
- meta = Metadata.build_hash_from(args, :warn_about_example_group_filtering)
1245
- filter_manager.include_with_low_priority meta
1246
- static_config_filter_manager.include_with_low_priority Metadata.deep_hash_dup(meta)
1247
- end
1248
- alias_method :filter_run, :filter_run_including
1249
-
1250
- # Applies the provided filter only if any of examples match, in constrast
1251
- # to {#filter_run}, which always applies even if no examples match, in
1252
- # which case no examples will be run. This allows you to leave configured
1253
- # filters in place that are intended only for temporary use. The most common
1254
- # example is focus filtering: `config.filter_run_when_matching :focus`.
1255
- # With that configured, you can temporarily focus an example or group
1256
- # by tagging it with `:focus` metadata, or prefixing it with an `f`
1257
- # (as in `fdescribe`, `fcontext` and `fit`) since those are aliases for
1258
- # `describe`/`context`/`it` with `:focus` metadata.
1259
- def filter_run_when_matching(*args)
1260
- when_first_matching_example_defined(*args) do
1261
- filter_run(*args)
1262
- end
1263
- end
1264
-
1265
- # Clears and reassigns the `inclusion_filter`. Set to `nil` if you don't
1266
- # want any inclusion filter at all.
1267
- #
1268
- # ### Warning
1269
- #
1270
- # This overrides any inclusion filters/tags set on the command line or in
1271
- # configuration files.
1272
- def inclusion_filter=(filter)
1273
- meta = Metadata.build_hash_from([filter], :warn_about_example_group_filtering)
1274
- filter_manager.include_only meta
1275
- end
1276
-
1277
- alias_method :filter=, :inclusion_filter=
1278
-
1279
- # Returns the `inclusion_filter`. If none has been set, returns an empty
1280
- # hash.
1281
- def inclusion_filter
1282
- filter_manager.inclusions
1283
- end
1284
-
1285
- alias_method :filter, :inclusion_filter
1286
-
1287
- # Adds key/value pairs to the `exclusion_filter`. If `args`
1288
- # includes any symbols that are not part of the hash, each symbol
1289
- # is treated as a key in the hash with the value `true`.
1290
- #
1291
- # ### Note
1292
- #
1293
- # Filters set using this method can be overridden from the command line
1294
- # or config files (e.g. `.rspec`).
1295
- #
1296
- # @example
1297
- # # Given this declaration.
1298
- # describe "something", :foo => 'bar' do
1299
- # # ...
1300
- # end
1301
- #
1302
- # # Any of the following will exclude that group.
1303
- # config.filter_run_excluding :foo => 'bar'
1304
- # config.filter_run_excluding :foo => /^ba/
1305
- # config.filter_run_excluding :foo => lambda {|v| v == 'bar'}
1306
- # config.filter_run_excluding :foo => lambda {|v,m| m[:foo] == 'bar'}
1307
- #
1308
- # # Given a proc with an arity of 1, the lambda is passed the value
1309
- # # related to the key, e.g.
1310
- # config.filter_run_excluding :foo => lambda {|v| v == 'bar'}
1311
- #
1312
- # # Given a proc with an arity of 2, the lambda is passed the value
1313
- # # related to the key, and the metadata itself e.g.
1314
- # config.filter_run_excluding :foo => lambda {|v,m| m[:foo] == 'bar'}
1315
- #
1316
- # filter_run_excluding :foo # same as filter_run_excluding :foo => true
1317
- def filter_run_excluding(*args)
1318
- meta = Metadata.build_hash_from(args, :warn_about_example_group_filtering)
1319
- filter_manager.exclude_with_low_priority meta
1320
- static_config_filter_manager.exclude_with_low_priority Metadata.deep_hash_dup(meta)
1321
- end
1322
-
1323
- # Clears and reassigns the `exclusion_filter`. Set to `nil` if you don't
1324
- # want any exclusion filter at all.
1325
- #
1326
- # ### Warning
1327
- #
1328
- # This overrides any exclusion filters/tags set on the command line or in
1329
- # configuration files.
1330
- def exclusion_filter=(filter)
1331
- meta = Metadata.build_hash_from([filter], :warn_about_example_group_filtering)
1332
- filter_manager.exclude_only meta
1333
- end
1334
-
1335
- # Returns the `exclusion_filter`. If none has been set, returns an empty
1336
- # hash.
1337
- def exclusion_filter
1338
- filter_manager.exclusions
1339
- end
1340
-
1341
- # Tells RSpec to include `mod` in example groups. Methods defined in
1342
- # `mod` are exposed to examples (not example groups). Use `filters` to
1343
- # constrain the groups or examples in which to include the module.
1344
- #
1345
- # @example
1346
- #
1347
- # module AuthenticationHelpers
1348
- # def login_as(user)
1349
- # # ...
1350
- # end
1351
- # end
1352
- #
1353
- # module UserHelpers
1354
- # def users(username)
1355
- # # ...
1356
- # end
1357
- # end
1358
- #
1359
- # RSpec.configure do |config|
1360
- # config.include(UserHelpers) # included in all groups
1361
- # config.include(AuthenticationHelpers, :type => :request)
1362
- # end
1363
- #
1364
- # describe "edit profile", :type => :request do
1365
- # it "can be viewed by owning user" do
1366
- # login_as users(:jdoe)
1367
- # get "/profiles/jdoe"
1368
- # assert_select ".username", :text => 'jdoe'
1369
- # end
1370
- # end
1371
- #
1372
- # @note Filtered module inclusions can also be applied to
1373
- # individual examples that have matching metadata. Just like
1374
- # Ruby's object model is that every object has a singleton class
1375
- # which has only a single instance, RSpec's model is that every
1376
- # example has a singleton example group containing just the one
1377
- # example.
1378
- #
1379
- # @see #include_context
1380
- # @see #extend
1381
- # @see #prepend
1382
- def include(mod, *filters)
1383
- define_mixed_in_module(mod, filters, @include_modules, :include) do |group|
1384
- safe_include(mod, group)
1385
- end
1386
- end
1387
-
1388
- # Tells RSpec to include the named shared example group in example groups.
1389
- # Use `filters` to constrain the groups or examples in which to include
1390
- # the example group.
1391
- #
1392
- # @example
1393
- #
1394
- # RSpec.shared_context "example users" do
1395
- # let(:admin_user) { create_user(:admin) }
1396
- # let(:guest_user) { create_user(:guest) }
1397
- # end
1398
- #
1399
- # RSpec.configure do |config|
1400
- # config.include_context "example users", :type => :request
1401
- # end
1402
- #
1403
- # RSpec.describe "The admin page", :type => :request do
1404
- # it "can be viewed by admins" do
1405
- # login_with admin_user
1406
- # get "/admin"
1407
- # expect(response).to be_ok
1408
- # end
1409
- #
1410
- # it "cannot be viewed by guests" do
1411
- # login_with guest_user
1412
- # get "/admin"
1413
- # expect(response).to be_forbidden
1414
- # end
1415
- # end
1416
- #
1417
- # @note Filtered context inclusions can also be applied to
1418
- # individual examples that have matching metadata. Just like
1419
- # Ruby's object model is that every object has a singleton class
1420
- # which has only a single instance, RSpec's model is that every
1421
- # example has a singleton example group containing just the one
1422
- # example.
1423
- #
1424
- # @see #include
1425
- def include_context(shared_group_name, *filters)
1426
- shared_module = world.shared_example_group_registry.find([:main], shared_group_name)
1427
- include shared_module, *filters
1428
- end
1429
-
1430
- # Tells RSpec to extend example groups with `mod`. Methods defined in
1431
- # `mod` are exposed to example groups (not examples). Use `filters` to
1432
- # constrain the groups to extend.
1433
- #
1434
- # Similar to `include`, but behavior is added to example groups, which
1435
- # are classes, rather than the examples, which are instances of those
1436
- # classes.
1437
- #
1438
- # @example
1439
- #
1440
- # module UiHelpers
1441
- # def run_in_browser
1442
- # # ...
1443
- # end
1444
- # end
1445
- #
1446
- # RSpec.configure do |config|
1447
- # config.extend(UiHelpers, :type => :request)
1448
- # end
1449
- #
1450
- # describe "edit profile", :type => :request do
1451
- # run_in_browser
1452
- #
1453
- # it "does stuff in the client" do
1454
- # # ...
1455
- # end
1456
- # end
1457
- #
1458
- # @see #include
1459
- # @see #prepend
1460
- def extend(mod, *filters)
1461
- define_mixed_in_module(mod, filters, @extend_modules, :extend) do |group|
1462
- safe_extend(mod, group)
1463
- end
1464
- end
1465
-
1466
- if RSpec::Support::RubyFeatures.module_prepends_supported?
1467
- # Tells RSpec to prepend example groups with `mod`. Methods defined in
1468
- # `mod` are exposed to examples (not example groups). Use `filters` to
1469
- # constrain the groups in which to prepend the module.
1470
- #
1471
- # Similar to `include`, but module is included before the example group's class
1472
- # in the ancestor chain.
1473
- #
1474
- # @example
1475
- #
1476
- # module OverrideMod
1477
- # def override_me
1478
- # "overridden"
1479
- # end
1480
- # end
1481
- #
1482
- # RSpec.configure do |config|
1483
- # config.prepend(OverrideMod, :method => :prepend)
1484
- # end
1485
- #
1486
- # describe "overriding example's class", :method => :prepend do
1487
- # it "finds the user" do
1488
- # self.class.class_eval do
1489
- # def override_me
1490
- # end
1491
- # end
1492
- # override_me # => "overridden"
1493
- # # ...
1494
- # end
1495
- # end
1496
- #
1497
- # @see #include
1498
- # @see #extend
1499
- def prepend(mod, *filters)
1500
- define_mixed_in_module(mod, filters, @prepend_modules, :prepend) do |group|
1501
- safe_prepend(mod, group)
1502
- end
1503
- end
1504
- end
1505
-
1506
- # @private
1507
- #
1508
- # Used internally to extend a group with modules using `include`, `prepend` and/or
1509
- # `extend`.
1510
- def configure_group(group)
1511
- group.hooks.register_globals(group, hooks)
1512
-
1513
- configure_group_with group, @include_modules, :safe_include
1514
- configure_group_with group, @extend_modules, :safe_extend
1515
- configure_group_with group, @prepend_modules, :safe_prepend
1516
- end
1517
-
1518
- # @private
1519
- #
1520
- # Used internally to extend the singleton class of a single example's
1521
- # example group instance with modules using `include` and/or `extend`.
1522
- def configure_example(example, example_hooks)
1523
- example_hooks.register_global_singleton_context_hooks(example, hooks)
1524
- singleton_group = example.example_group_instance.singleton_class
1525
-
1526
- # We replace the metadata so that SharedExampleGroupModule#included
1527
- # has access to the example's metadata[:location].
1528
- singleton_group.with_replaced_metadata(example.metadata) do
1529
- modules = @include_modules.items_for(example.metadata)
1530
- modules.each do |mod|
1531
- safe_include(mod, example.example_group_instance.singleton_class)
1532
- end
1533
-
1534
- MemoizedHelpers.define_helpers_on(singleton_group) unless modules.empty?
1535
- end
1536
- end
1537
-
1538
- # @private
1539
- def requires=(paths)
1540
- directories = ['lib', default_path].select { |p| File.directory? p }
1541
- RSpec::Core::RubyProject.add_to_load_path(*directories)
1542
- paths.each { |path| load_file_handling_errors(:require, path) }
1543
- @requires += paths
1544
- end
1545
-
1546
- # @private
1547
- def in_project_source_dir_regex
1548
- regexes = project_source_dirs.map do |dir|
1549
- /\A#{Regexp.escape(File.expand_path(dir))}\//
1550
- end
1551
-
1552
- Regexp.union(regexes)
1553
- end
1554
-
1555
- # @private
1556
- def configure_mock_framework
1557
- RSpec::Core::ExampleGroup.__send__(:include, mock_framework)
1558
- conditionally_disable_mocks_monkey_patching
1559
- end
1560
-
1561
- # @private
1562
- def configure_expectation_framework
1563
- expectation_frameworks.each do |framework|
1564
- RSpec::Core::ExampleGroup.__send__(:include, framework)
1565
- end
1566
- conditionally_disable_expectations_monkey_patching
1567
- end
1568
-
1569
- # @private
1570
- def load_spec_files
1571
- # Note which spec files world is already aware of.
1572
- # This is generally only needed for when the user runs
1573
- # `ruby path/to/spec.rb` (and loads `rspec/autorun`) --
1574
- # in that case, the spec file was loaded by `ruby` and
1575
- # isn't loaded by us here so we only know about it because
1576
- # of an example group being registered in it.
1577
- world.registered_example_group_files.each do |f|
1578
- loaded_spec_files << f # the registered files are already expended absolute paths
1579
- end
1580
-
1581
- files_to_run.uniq.each do |f|
1582
- file = File.expand_path(f)
1583
- load_file_handling_errors(:load, file)
1584
- loaded_spec_files << file
1585
- end
1586
-
1587
- @spec_files_loaded = true
1588
- end
1589
-
1590
- # @private
1591
- DEFAULT_FORMATTER = lambda { |string| string }
1592
-
1593
- # Formats the docstring output using the block provided.
1594
- #
1595
- # @example
1596
- # # This will strip the descriptions of both examples and example
1597
- # # groups.
1598
- # RSpec.configure do |config|
1599
- # config.format_docstrings { |s| s.strip }
1600
- # end
1601
- def format_docstrings(&block)
1602
- @format_docstrings_block = block_given? ? block : DEFAULT_FORMATTER
1603
- end
1604
-
1605
- # @private
1606
- def format_docstrings_block
1607
- @format_docstrings_block ||= DEFAULT_FORMATTER
1608
- end
1609
-
1610
- # @private
1611
- def self.delegate_to_ordering_manager(*methods)
1612
- methods.each do |method|
1613
- define_method method do |*args, &block|
1614
- ordering_manager.__send__(method, *args, &block)
1615
- end
1616
- end
1617
- end
1618
-
1619
- # @!method seed=(value)
1620
- #
1621
- # Sets the seed value and sets the default global ordering to random.
1622
- delegate_to_ordering_manager :seed=
1623
-
1624
- # @!method seed
1625
- # Seed for random ordering (default: generated randomly each run).
1626
- #
1627
- # When you run specs with `--order random`, RSpec generates a random seed
1628
- # for the randomization and prints it to the `output_stream` (assuming
1629
- # you're using RSpec's built-in formatters). If you discover an ordering
1630
- # dependency (i.e. examples fail intermittently depending on order), set
1631
- # this (on Configuration or on the command line with `--seed`) to run
1632
- # using the same seed while you debug the issue.
1633
- #
1634
- # We recommend, actually, that you use the command line approach so you
1635
- # don't accidentally leave the seed encoded.
1636
- delegate_to_ordering_manager :seed
1637
-
1638
- # @!method order=(value)
1639
- #
1640
- # Sets the default global ordering strategy. By default this can be one
1641
- # of `:defined`, `:random`, but is customizable through the
1642
- # `register_ordering` API. If order is set to `'rand:<seed>'`,
1643
- # the seed will also be set.
1644
- #
1645
- # @see #register_ordering
1646
- delegate_to_ordering_manager :order=
1647
-
1648
- # @!method register_ordering(name)
1649
- #
1650
- # Registers a named ordering strategy that can later be
1651
- # used to order an example group's subgroups by adding
1652
- # `:order => <name>` metadata to the example group.
1653
- #
1654
- # @param name [Symbol] The name of the ordering.
1655
- # @yield Block that will order the given examples or example groups
1656
- # @yieldparam list [Array<RSpec::Core::Example>,
1657
- # Array<RSpec::Core::ExampleGroup>] The examples or groups to order
1658
- # @yieldreturn [Array<RSpec::Core::Example>,
1659
- # Array<RSpec::Core::ExampleGroup>] The re-ordered examples or groups
1660
- #
1661
- # @example
1662
- # RSpec.configure do |rspec|
1663
- # rspec.register_ordering :reverse do |list|
1664
- # list.reverse
1665
- # end
1666
- # end
1667
- #
1668
- # RSpec.describe 'MyClass', :order => :reverse do
1669
- # # ...
1670
- # end
1671
- #
1672
- # @note Pass the symbol `:global` to set the ordering strategy that
1673
- # will be used to order the top-level example groups and any example
1674
- # groups that do not have declared `:order` metadata.
1675
- #
1676
- # @example
1677
- # RSpec.configure do |rspec|
1678
- # rspec.register_ordering :global do |examples|
1679
- # acceptance, other = examples.partition do |example|
1680
- # example.metadata[:type] == :acceptance
1681
- # end
1682
- # other + acceptance
1683
- # end
1684
- # end
1685
- #
1686
- # RSpec.describe 'MyClass', :type => :acceptance do
1687
- # # will run last
1688
- # end
1689
- #
1690
- # RSpec.describe 'MyClass' do
1691
- # # will run first
1692
- # end
1693
- #
1694
- delegate_to_ordering_manager :register_ordering
1695
-
1696
- # @private
1697
- delegate_to_ordering_manager :seed_used?, :ordering_registry
1698
-
1699
- # Set Ruby warnings on or off.
1700
- def warnings=(value)
1701
- $VERBOSE = !!value
1702
- end
1703
-
1704
- # @return [Boolean] Whether or not ruby warnings are enabled.
1705
- def warnings?
1706
- $VERBOSE
1707
- end
1708
-
1709
- # @private
1710
- RAISE_ERROR_WARNING_NOTIFIER = lambda { |message| raise message }
1711
-
1712
- # Turns warnings into errors. This can be useful when
1713
- # you want RSpec to run in a 'strict' no warning situation.
1714
- #
1715
- # @example
1716
- #
1717
- # RSpec.configure do |rspec|
1718
- # rspec.raise_on_warning = true
1719
- # end
1720
- def raise_on_warning=(value)
1721
- if value
1722
- RSpec::Support.warning_notifier = RAISE_ERROR_WARNING_NOTIFIER
1723
- else
1724
- RSpec::Support.warning_notifier = RSpec::Support::DEFAULT_WARNING_NOTIFIER
1725
- end
1726
- end
1727
-
1728
- # Exposes the current running example via the named
1729
- # helper method. RSpec 2.x exposed this via `example`,
1730
- # but in RSpec 3.0, the example is instead exposed via
1731
- # an arg yielded to `it`, `before`, `let`, etc. However,
1732
- # some extension gems (such as Capybara) depend on the
1733
- # RSpec 2.x's `example` method, so this config option
1734
- # can be used to maintain compatibility.
1735
- #
1736
- # @param method_name [Symbol] the name of the helper method
1737
- #
1738
- # @example
1739
- #
1740
- # RSpec.configure do |rspec|
1741
- # rspec.expose_current_running_example_as :example
1742
- # end
1743
- #
1744
- # RSpec.describe MyClass do
1745
- # before do
1746
- # # `example` can be used here because of the above config.
1747
- # do_something if example.metadata[:type] == "foo"
1748
- # end
1749
- # end
1750
- def expose_current_running_example_as(method_name)
1751
- ExposeCurrentExample.module_exec do
1752
- extend RSpec::SharedContext
1753
- let(method_name) { |ex| ex }
1754
- end
1755
-
1756
- include ExposeCurrentExample
1757
- end
1758
-
1759
- # @private
1760
- module ExposeCurrentExample; end
1761
-
1762
- # Turns deprecation warnings into errors, in order to surface
1763
- # the full backtrace of the call site. This can be useful when
1764
- # you need more context to address a deprecation than the
1765
- # single-line call site normally provided.
1766
- #
1767
- # @example
1768
- #
1769
- # RSpec.configure do |rspec|
1770
- # rspec.raise_errors_for_deprecations!
1771
- # end
1772
- def raise_errors_for_deprecations!
1773
- self.deprecation_stream = Formatters::DeprecationFormatter::RaiseErrorStream.new
1774
- end
1775
-
1776
- # Enables zero monkey patching mode for RSpec. It removes monkey
1777
- # patching of the top-level DSL methods (`describe`,
1778
- # `shared_examples_for`, etc) onto `main` and `Module`, instead
1779
- # requiring you to prefix these methods with `RSpec.`. It enables
1780
- # expect-only syntax for rspec-mocks and rspec-expectations. It
1781
- # simply disables monkey patching on whatever pieces of RSpec
1782
- # the user is using.
1783
- #
1784
- # @note It configures rspec-mocks and rspec-expectations only
1785
- # if the user is using those (either explicitly or implicitly
1786
- # by not setting `mock_with` or `expect_with` to anything else).
1787
- #
1788
- # @note If the user uses this options with `mock_with :mocha`
1789
- # (or similiar) they will still have monkey patching active
1790
- # in their test environment from mocha.
1791
- #
1792
- # @example
1793
- #
1794
- # # It disables all monkey patching.
1795
- # RSpec.configure do |config|
1796
- # config.disable_monkey_patching!
1797
- # end
1798
- #
1799
- # # Is an equivalent to
1800
- # RSpec.configure do |config|
1801
- # config.expose_dsl_globally = false
1802
- #
1803
- # config.mock_with :rspec do |mocks|
1804
- # mocks.syntax = :expect
1805
- # mocks.patch_marshal_to_support_partial_doubles = false
1806
- # end
1807
- #
1808
- # config.expect_with :rspec do |expectations|
1809
- # expectations.syntax = :expect
1810
- # end
1811
- # end
1812
- def disable_monkey_patching!
1813
- self.expose_dsl_globally = false
1814
- self.disable_monkey_patching = true
1815
- conditionally_disable_mocks_monkey_patching
1816
- conditionally_disable_expectations_monkey_patching
1817
- end
1818
-
1819
- # @private
1820
- attr_accessor :disable_monkey_patching
1821
-
1822
- # Defines a callback that can assign derived metadata values.
1823
- #
1824
- # @param filters [Array<Symbol>, Hash] metadata filters that determine
1825
- # which example or group metadata hashes the callback will be triggered
1826
- # for. If none are given, the callback will be run against the metadata
1827
- # hashes of all groups and examples.
1828
- # @yieldparam metadata [Hash] original metadata hash from an example or
1829
- # group. Mutate this in your block as needed.
1830
- #
1831
- # @example
1832
- # RSpec.configure do |config|
1833
- # # Tag all groups and examples in the spec/unit directory with
1834
- # # :type => :unit
1835
- # config.define_derived_metadata(:file_path => %r{/spec/unit/}) do |metadata|
1836
- # metadata[:type] = :unit
1837
- # end
1838
- # end
1839
- def define_derived_metadata(*filters, &block)
1840
- meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
1841
- @derived_metadata_blocks.append(block, meta)
1842
- end
1843
-
1844
- # Defines a callback that runs after the first example with matching
1845
- # metadata is defined. If no examples are defined with matching metadata,
1846
- # it will not get called at all.
1847
- #
1848
- # This can be used to ensure some setup is performed (such as bootstrapping
1849
- # a DB or loading a specific file that adds significantly to the boot time)
1850
- # if needed (as indicated by the presence of an example with matching metadata)
1851
- # but avoided otherwise.
1852
- #
1853
- # @example
1854
- # RSpec.configure do |config|
1855
- # config.when_first_matching_example_defined(:db) do
1856
- # # Load a support file that does some heavyweight setup,
1857
- # # including bootstrapping the DB, but only if we have loaded
1858
- # # any examples tagged with `:db`.
1859
- # require 'support/db'
1860
- # end
1861
- # end
1862
- def when_first_matching_example_defined(*filters)
1863
- specified_meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
1864
-
1865
- callback = lambda do |example_or_group_meta|
1866
- # Example groups do not have `:example_group` metadata
1867
- # (instead they have `:parent_example_group` metadata).
1868
- return unless example_or_group_meta.key?(:example_group)
1869
-
1870
- # Ensure the callback only fires once.
1871
- @derived_metadata_blocks.delete(callback, specified_meta)
1872
-
1873
- yield
1874
- end
1875
-
1876
- @derived_metadata_blocks.append(callback, specified_meta)
1877
- end
1878
-
1879
- # @private
1880
- def apply_derived_metadata_to(metadata)
1881
- already_run_blocks = Set.new
1882
-
1883
- # We loop and attempt to re-apply metadata blocks to support cascades
1884
- # (e.g. where a derived bit of metadata triggers the application of
1885
- # another piece of derived metadata, etc)
1886
- #
1887
- # We limit our looping to 200 times as a way to detect infinitely recursing derived metadata blocks.
1888
- # It's hard to imagine a valid use case for a derived metadata cascade greater than 200 iterations.
1889
- 200.times do
1890
- return if @derived_metadata_blocks.items_for(metadata).all? do |block|
1891
- already_run_blocks.include?(block).tap do |skip_block|
1892
- block.call(metadata) unless skip_block
1893
- already_run_blocks << block
1894
- end
1895
- end
1896
- end
1897
-
1898
- # If we got here, then `@derived_metadata_blocks.items_for(metadata).all?` never returned
1899
- # `true` above and we treat this as an attempt to recurse infinitely. It's better to fail
1900
- # with a clear # error than hang indefinitely, which is what would happen if we didn't limit
1901
- # the looping above.
1902
- raise SystemStackError, "Attempted to recursively derive metadata indefinitely."
1903
- end
1904
-
1905
- # Defines a `before` hook. See {Hooks#before} for full docs.
1906
- #
1907
- # This method differs from {Hooks#before} in only one way: it supports
1908
- # the `:suite` scope. Hooks with the `:suite` scope will be run once before
1909
- # the first example of the entire suite is executed.
1910
- #
1911
- # @see #prepend_before
1912
- # @see #after
1913
- # @see #append_after
1914
- def before(scope=nil, *meta, &block)
1915
- handle_suite_hook(scope, meta) do
1916
- @before_suite_hooks << Hooks::BeforeHook.new(block, {})
1917
- end || begin
1918
- # defeat Ruby 2.5 lazy proc allocation to ensure
1919
- # the methods below are passed the same proc instances
1920
- # so `Hook` equality is preserved. For more info, see:
1921
- # https://bugs.ruby-lang.org/issues/14045#note-5
1922
- block.__id__
1923
-
1924
- add_hook_to_existing_matching_groups(meta, scope) { |g| g.before(scope, *meta, &block) }
1925
- super(scope, *meta, &block)
1926
- end
1927
- end
1928
- alias_method :append_before, :before
1929
-
1930
- # Adds `block` to the start of the list of `before` blocks in the same
1931
- # scope (`:example`, `:context`, or `:suite`), in contrast to {#before},
1932
- # which adds the hook to the end of the list.
1933
- #
1934
- # See {Hooks#before} for full `before` hook docs.
1935
- #
1936
- # This method differs from {Hooks#prepend_before} in only one way: it supports
1937
- # the `:suite` scope. Hooks with the `:suite` scope will be run once before
1938
- # the first example of the entire suite is executed.
1939
- #
1940
- # @see #before
1941
- # @see #after
1942
- # @see #append_after
1943
- def prepend_before(scope=nil, *meta, &block)
1944
- handle_suite_hook(scope, meta) do
1945
- @before_suite_hooks.unshift Hooks::BeforeHook.new(block, {})
1946
- end || begin
1947
- # defeat Ruby 2.5 lazy proc allocation to ensure
1948
- # the methods below are passed the same proc instances
1949
- # so `Hook` equality is preserved. For more info, see:
1950
- # https://bugs.ruby-lang.org/issues/14045#note-5
1951
- block.__id__
1952
-
1953
- add_hook_to_existing_matching_groups(meta, scope) { |g| g.prepend_before(scope, *meta, &block) }
1954
- super(scope, *meta, &block)
1955
- end
1956
- end
1957
-
1958
- # Defines a `after` hook. See {Hooks#after} for full docs.
1959
- #
1960
- # This method differs from {Hooks#after} in only one way: it supports
1961
- # the `:suite` scope. Hooks with the `:suite` scope will be run once after
1962
- # the last example of the entire suite is executed.
1963
- #
1964
- # @see #append_after
1965
- # @see #before
1966
- # @see #prepend_before
1967
- def after(scope=nil, *meta, &block)
1968
- handle_suite_hook(scope, meta) do
1969
- @after_suite_hooks.unshift Hooks::AfterHook.new(block, {})
1970
- end || begin
1971
- # defeat Ruby 2.5 lazy proc allocation to ensure
1972
- # the methods below are passed the same proc instances
1973
- # so `Hook` equality is preserved. For more info, see:
1974
- # https://bugs.ruby-lang.org/issues/14045#note-5
1975
- block.__id__
1976
-
1977
- add_hook_to_existing_matching_groups(meta, scope) { |g| g.after(scope, *meta, &block) }
1978
- super(scope, *meta, &block)
1979
- end
1980
- end
1981
- alias_method :prepend_after, :after
1982
-
1983
- # Adds `block` to the end of the list of `after` blocks in the same
1984
- # scope (`:example`, `:context`, or `:suite`), in contrast to {#after},
1985
- # which adds the hook to the start of the list.
1986
- #
1987
- # See {Hooks#after} for full `after` hook docs.
1988
- #
1989
- # This method differs from {Hooks#append_after} in only one way: it supports
1990
- # the `:suite` scope. Hooks with the `:suite` scope will be run once after
1991
- # the last example of the entire suite is executed.
1992
- #
1993
- # @see #append_after
1994
- # @see #before
1995
- # @see #prepend_before
1996
- def append_after(scope=nil, *meta, &block)
1997
- handle_suite_hook(scope, meta) do
1998
- @after_suite_hooks << Hooks::AfterHook.new(block, {})
1999
- end || begin
2000
- # defeat Ruby 2.5 lazy proc allocation to ensure
2001
- # the methods below are passed the same proc instances
2002
- # so `Hook` equality is preserved. For more info, see:
2003
- # https://bugs.ruby-lang.org/issues/14045#note-5
2004
- block.__id__
2005
-
2006
- add_hook_to_existing_matching_groups(meta, scope) { |g| g.append_after(scope, *meta, &block) }
2007
- super(scope, *meta, &block)
2008
- end
2009
- end
2010
-
2011
- # Registers `block` as an `around` hook.
2012
- #
2013
- # See {Hooks#around} for full `around` hook docs.
2014
- def around(scope=nil, *meta, &block)
2015
- # defeat Ruby 2.5 lazy proc allocation to ensure
2016
- # the methods below are passed the same proc instances
2017
- # so `Hook` equality is preserved. For more info, see:
2018
- # https://bugs.ruby-lang.org/issues/14045#note-5
2019
- block.__id__
2020
-
2021
- add_hook_to_existing_matching_groups(meta, scope) { |g| g.around(scope, *meta, &block) }
2022
- super(scope, *meta, &block)
2023
- end
2024
-
2025
- # @private
2026
- def with_suite_hooks
2027
- return yield if dry_run?
2028
-
2029
- begin
2030
- run_suite_hooks("a `before(:suite)` hook", @before_suite_hooks)
2031
- yield
2032
- ensure
2033
- run_suite_hooks("an `after(:suite)` hook", @after_suite_hooks)
2034
- end
2035
- end
2036
-
2037
- # @private
2038
- # Holds the various registered hooks. Here we use a FilterableItemRepository
2039
- # implementation that is specifically optimized for the read/write patterns
2040
- # of the config object.
2041
- def hooks
2042
- @hooks ||= HookCollections.new(self, FilterableItemRepository::QueryOptimized)
2043
- end
2044
-
2045
- # Invokes block before defining an example group
2046
- def on_example_group_definition(&block)
2047
- on_example_group_definition_callbacks << block
2048
- end
2049
-
2050
- # @api private
2051
- # Returns an array of blocks to call before defining an example group
2052
- def on_example_group_definition_callbacks
2053
- @on_example_group_definition_callbacks ||= []
2054
- end
2055
-
2056
- # @private
2057
- def bisect_runner_class
2058
- @bisect_runner_class ||= begin
2059
- case bisect_runner
2060
- when :fork
2061
- RSpec::Support.require_rspec_core 'bisect/fork_runner'
2062
- Bisect::ForkRunner
2063
- when :shell
2064
- RSpec::Support.require_rspec_core 'bisect/shell_runner'
2065
- Bisect::ShellRunner
2066
- else
2067
- raise "Unsupported value for `bisect_runner` (#{bisect_runner.inspect}). " \
2068
- "Only `:fork` and `:shell` are supported."
2069
- end
2070
- end
2071
- end
2072
-
2073
- private
2074
-
2075
- def load_file_handling_errors(method, file)
2076
- __send__(method, file)
2077
- rescue LoadError => ex
2078
- relative_file = Metadata.relative_path(file)
2079
- suggestions = DidYouMean.new(relative_file).call
2080
- reporter.notify_non_example_exception(ex, "An error occurred while loading #{relative_file}.#{suggestions}")
2081
- RSpec.world.wants_to_quit = true
2082
- rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
2083
- relative_file = Metadata.relative_path(file)
2084
- reporter.notify_non_example_exception(ex, "An error occurred while loading #{relative_file}.")
2085
- RSpec.world.wants_to_quit = true
2086
- end
2087
-
2088
- def handle_suite_hook(scope, meta)
2089
- return nil unless scope == :suite
2090
-
2091
- unless meta.empty?
2092
- # TODO: in RSpec 4, consider raising an error here.
2093
- # We warn only for backwards compatibility.
2094
- RSpec.warn_with "WARNING: `:suite` hooks do not support metadata since " \
2095
- "they apply to the suite as a whole rather than " \
2096
- "any individual example or example group that has metadata. " \
2097
- "The metadata you have provided (#{meta.inspect}) will be ignored."
2098
- end
2099
-
2100
- yield
2101
- end
2102
-
2103
- def run_suite_hooks(hook_description, hooks)
2104
- context = SuiteHookContext.new(hook_description, reporter)
2105
-
2106
- hooks.each do |hook|
2107
- begin
2108
- hook.run(context)
2109
- rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
2110
- context.set_exception(ex)
2111
-
2112
- # Do not run subsequent `before` hooks if one fails.
2113
- # But for `after` hooks, we run them all so that all
2114
- # cleanup bits get a chance to complete, minimizing the
2115
- # chance that resources get left behind.
2116
- break if hooks.equal?(@before_suite_hooks)
2117
- end
2118
- end
2119
- end
2120
-
2121
- def get_files_to_run(paths)
2122
- files = FlatMap.flat_map(paths_to_check(paths)) do |path|
2123
- path = path.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
2124
- File.directory?(path) ? gather_directories(path) : extract_location(path)
2125
- end.uniq
2126
-
2127
- return files unless only_failures?
2128
- relative_files = files.map { |f| Metadata.relative_path(File.expand_path f) }
2129
- intersection = (relative_files & spec_files_with_failures.to_a)
2130
- intersection.empty? ? files : intersection
2131
- end
2132
-
2133
- def paths_to_check(paths)
2134
- return paths if pattern_might_load_specs_from_vendored_dirs?
2135
- paths + [Dir.getwd]
2136
- end
2137
-
2138
- def pattern_might_load_specs_from_vendored_dirs?
2139
- pattern.split(File::SEPARATOR).first.include?('**')
2140
- end
2141
-
2142
- def gather_directories(path)
2143
- include_files = get_matching_files(path, pattern)
2144
- exclude_files = get_matching_files(path, exclude_pattern)
2145
- (include_files - exclude_files).uniq
2146
- end
2147
-
2148
- def get_matching_files(path, pattern)
2149
- raw_files = Dir[file_glob_from(path, pattern)]
2150
- raw_files.map { |file| File.expand_path(file) }.sort
2151
- end
2152
-
2153
- def file_glob_from(path, pattern)
2154
- stripped = "{#{pattern.gsub(/\s*,\s*/, ',')}}"
2155
- return stripped if pattern =~ /^(\.\/)?#{Regexp.escape path}/ || absolute_pattern?(pattern)
2156
- File.join(path, stripped)
2157
- end
2158
-
2159
- if RSpec::Support::OS.windows?
2160
- # :nocov:
2161
- def absolute_pattern?(pattern)
2162
- pattern =~ /\A[A-Z]:\\/ || windows_absolute_network_path?(pattern)
2163
- end
2164
-
2165
- def windows_absolute_network_path?(pattern)
2166
- return false unless ::File::ALT_SEPARATOR
2167
- pattern.start_with?(::File::ALT_SEPARATOR + ::File::ALT_SEPARATOR)
2168
- end
2169
- # :nocov:
2170
- else
2171
- def absolute_pattern?(pattern)
2172
- pattern.start_with?(File::Separator)
2173
- end
2174
- end
2175
-
2176
- def extract_location(path)
2177
- match = /^(.*?)((?:\:\d+)+)$/.match(path)
2178
-
2179
- if match
2180
- captures = match.captures
2181
- path = captures[0]
2182
- lines = captures[1][1..-1].split(":").map(&:to_i)
2183
- filter_manager.add_location path, lines
2184
- else
2185
- path, scoped_ids = Example.parse_id(path)
2186
- filter_manager.add_ids(path, scoped_ids.split(/\s*,\s*/)) if scoped_ids
2187
- end
2188
-
2189
- return [] if path == default_path
2190
- File.expand_path(path)
2191
- end
2192
-
2193
- def command
2194
- $0.split(File::SEPARATOR).last
2195
- end
2196
-
2197
- def value_for(key)
2198
- @preferred_options.fetch(key) { yield }
2199
- end
2200
-
2201
- def define_built_in_hooks
2202
- around(:example, :aggregate_failures => true) do |procsy|
2203
- begin
2204
- aggregate_failures(nil, :hide_backtrace => true, &procsy)
2205
- rescue Support::AllExceptionsExceptOnesWeMustNotRescue => exception
2206
- procsy.example.set_aggregate_failures_exception(exception)
2207
- end
2208
- end
2209
- end
2210
-
2211
- def assert_no_example_groups_defined(config_option)
2212
- return unless world.example_groups.any?
2213
-
2214
- raise MustBeConfiguredBeforeExampleGroupsError.new(
2215
- "RSpec's #{config_option} configuration option must be configured before " \
2216
- "any example groups are defined, but you have already defined a group."
2217
- )
2218
- end
2219
-
2220
- def output_wrapper
2221
- @output_wrapper ||= OutputWrapper.new(output_stream)
2222
- end
2223
-
2224
- def output_to_tty?(output=output_stream)
2225
- output.respond_to?(:tty?) && output.tty?
2226
- end
2227
-
2228
- def conditionally_disable_mocks_monkey_patching
2229
- return unless disable_monkey_patching && rspec_mocks_loaded?
2230
-
2231
- RSpec::Mocks.configuration.tap do |config|
2232
- config.syntax = :expect
2233
- config.patch_marshal_to_support_partial_doubles = false
2234
- end
2235
- end
2236
-
2237
- def conditionally_disable_expectations_monkey_patching
2238
- return unless disable_monkey_patching && rspec_expectations_loaded?
2239
-
2240
- RSpec::Expectations.configuration.syntax = :expect
2241
- end
2242
-
2243
- def rspec_mocks_loaded?
2244
- defined?(RSpec::Mocks.configuration)
2245
- end
2246
-
2247
- def rspec_expectations_loaded?
2248
- defined?(RSpec::Expectations.configuration)
2249
- end
2250
-
2251
- def update_pattern_attr(name, value)
2252
- if @spec_files_loaded
2253
- RSpec.warning "Configuring `#{name}` to #{value} has no effect since " \
2254
- "RSpec has already loaded the spec files."
2255
- end
2256
-
2257
- instance_variable_set(:"@#{name}", value)
2258
- @files_to_run = nil
2259
- end
2260
-
2261
- def clear_values_derived_from_example_status_persistence_file_path
2262
- @last_run_statuses = nil
2263
- @spec_files_with_failures = nil
2264
- end
2265
-
2266
- def configure_group_with(group, module_list, application_method)
2267
- module_list.items_for(group.metadata).each do |mod|
2268
- __send__(application_method, mod, group)
2269
- end
2270
- end
2271
-
2272
- def add_hook_to_existing_matching_groups(meta, scope, &block)
2273
- # For example hooks, we have to apply it to each of the top level
2274
- # groups, even if the groups do not match. When we apply it, we
2275
- # apply it with the metadata, so it will only apply to examples
2276
- # in the group that match the metadata.
2277
- # #2280 for background and discussion.
2278
- if scope == :example || scope == :each || scope.nil?
2279
- world.example_groups.each(&block)
2280
- else
2281
- meta = Metadata.build_hash_from(meta.dup)
2282
- on_existing_matching_groups(meta, &block)
2283
- end
2284
- end
2285
-
2286
- def on_existing_matching_groups(meta)
2287
- world.traverse_example_group_trees_until do |group|
2288
- metadata_applies_to_group?(meta, group).tap do |applies|
2289
- yield group if applies
2290
- end
2291
- end
2292
- end
2293
-
2294
- def metadata_applies_to_group?(meta, group)
2295
- meta.empty? || MetadataFilter.apply?(:any?, meta, group.metadata)
2296
- end
2297
-
2298
- if RSpec::Support::RubyFeatures.module_prepends_supported?
2299
- def safe_prepend(mod, host)
2300
- host.__send__(:prepend, mod) unless host < mod
2301
- end
2302
- end
2303
-
2304
- if RUBY_VERSION.to_f >= 1.9
2305
- def safe_include(mod, host)
2306
- host.__send__(:include, mod) unless host < mod
2307
- end
2308
-
2309
- def safe_extend(mod, host)
2310
- host.extend(mod) unless host.singleton_class < mod
2311
- end
2312
- else # for 1.8.7
2313
- # :nocov:
2314
- def safe_include(mod, host)
2315
- host.__send__(:include, mod) unless host.included_modules.include?(mod)
2316
- end
2317
-
2318
- def safe_extend(mod, host)
2319
- host.extend(mod) unless (class << host; self; end).included_modules.include?(mod)
2320
- end
2321
- # :nocov:
2322
- end
2323
-
2324
- def define_mixed_in_module(mod, filters, mod_list, config_method, &block)
2325
- unless Module === mod
2326
- raise TypeError, "`RSpec.configuration.#{config_method}` expects a module but got: #{mod.inspect}"
2327
- end
2328
-
2329
- meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
2330
- mod_list.append(mod, meta)
2331
- on_existing_matching_groups(meta, &block)
2332
- end
2333
- end
2334
- # rubocop:enable Metrics/ClassLength
2335
- end
2336
- end