takuya-lvm-snapshot 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +4 -0
  4. data/Gemfile +10 -0
  5. data/LICENSE +674 -0
  6. data/README.md +80 -0
  7. data/Rakefile +4 -0
  8. data/bin/console +15 -0
  9. data/bin/setup +8 -0
  10. data/bundle/ruby/2.7.0/bin/htmldiff +29 -0
  11. data/bundle/ruby/2.7.0/bin/ldiff +29 -0
  12. data/bundle/ruby/2.7.0/bin/rake +27 -0
  13. data/bundle/ruby/2.7.0/bin/rspec +27 -0
  14. data/bundle/ruby/2.7.0/cache/diff-lcs-1.5.0.gem +0 -0
  15. data/bundle/ruby/2.7.0/cache/rake-13.0.3.gem +0 -0
  16. data/bundle/ruby/2.7.0/cache/rspec-3.12.0.gem +0 -0
  17. data/bundle/ruby/2.7.0/cache/rspec-core-3.12.0.gem +0 -0
  18. data/bundle/ruby/2.7.0/cache/rspec-expectations-3.12.1.gem +0 -0
  19. data/bundle/ruby/2.7.0/cache/rspec-mocks-3.12.1.gem +0 -0
  20. data/bundle/ruby/2.7.0/cache/rspec-support-3.12.0.gem +0 -0
  21. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/.rspec +1 -0
  22. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/Code-of-Conduct.md +74 -0
  23. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/Contributing.md +119 -0
  24. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/History.md +400 -0
  25. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/License.md +39 -0
  26. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/Manifest.txt +59 -0
  27. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/README.rdoc +84 -0
  28. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/Rakefile +121 -0
  29. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/bin/htmldiff +35 -0
  30. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/bin/ldiff +9 -0
  31. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/docs/COPYING.txt +339 -0
  32. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/docs/artistic.txt +127 -0
  33. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/array.rb +7 -0
  34. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/backports.rb +9 -0
  35. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/block.rb +37 -0
  36. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/callbacks.rb +325 -0
  37. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/change.rb +174 -0
  38. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/htmldiff.rb +150 -0
  39. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/hunk.rb +358 -0
  40. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/internals.rb +308 -0
  41. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/ldiff.rb +171 -0
  42. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs/string.rb +5 -0
  43. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff/lcs.rb +739 -0
  44. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/lib/diff-lcs.rb +3 -0
  45. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/change_spec.rb +89 -0
  46. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/diff_spec.rb +51 -0
  47. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/aX +1 -0
  48. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/bXaX +1 -0
  49. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ds1.csv +50 -0
  50. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ds2.csv +51 -0
  51. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff +4 -0
  52. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff-c +7 -0
  53. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff-e +3 -0
  54. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff-f +3 -0
  55. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff-u +5 -0
  56. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef +4 -0
  57. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef-c +15 -0
  58. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef-e +3 -0
  59. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef-f +3 -0
  60. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef-u +9 -0
  61. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef2 +7 -0
  62. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef2-c +20 -0
  63. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef2-d +7 -0
  64. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef2-e +7 -0
  65. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef2-f +7 -0
  66. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/ldiff/output.diff.chef2-u +16 -0
  67. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/new-chef +4 -0
  68. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/new-chef2 +17 -0
  69. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/old-chef +4 -0
  70. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/fixtures/old-chef2 +14 -0
  71. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/hunk_spec.rb +83 -0
  72. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/issues_spec.rb +154 -0
  73. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/lcs_spec.rb +56 -0
  74. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/ldiff_spec.rb +87 -0
  75. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/patch_spec.rb +416 -0
  76. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/sdiff_spec.rb +214 -0
  77. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/spec_helper.rb +374 -0
  78. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/traverse_balanced_spec.rb +310 -0
  79. data/bundle/ruby/2.7.0/gems/diff-lcs-1.5.0/spec/traverse_sequences_spec.rb +137 -0
  80. data/bundle/ruby/2.7.0/gems/rake-13.0.3/CONTRIBUTING.rdoc +43 -0
  81. data/bundle/ruby/2.7.0/gems/rake-13.0.3/Gemfile +10 -0
  82. data/bundle/ruby/2.7.0/gems/rake-13.0.3/History.rdoc +2386 -0
  83. data/bundle/ruby/2.7.0/gems/rake-13.0.3/MIT-LICENSE +21 -0
  84. data/bundle/ruby/2.7.0/gems/rake-13.0.3/README.rdoc +155 -0
  85. data/bundle/ruby/2.7.0/gems/rake-13.0.3/Rakefile +41 -0
  86. data/bundle/ruby/2.7.0/gems/rake-13.0.3/bin/bundle +105 -0
  87. data/bundle/ruby/2.7.0/gems/rake-13.0.3/bin/console +7 -0
  88. data/bundle/ruby/2.7.0/gems/rake-13.0.3/bin/rake +29 -0
  89. data/bundle/ruby/2.7.0/gems/rake-13.0.3/bin/rdoc +29 -0
  90. data/bundle/ruby/2.7.0/gems/rake-13.0.3/bin/rubocop +29 -0
  91. data/bundle/ruby/2.7.0/gems/rake-13.0.3/bin/setup +6 -0
  92. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/command_line_usage.rdoc +158 -0
  93. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/example/Rakefile1 +38 -0
  94. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/example/Rakefile2 +35 -0
  95. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/example/a.c +6 -0
  96. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/example/b.c +6 -0
  97. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/example/main.c +11 -0
  98. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/glossary.rdoc +42 -0
  99. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/jamis.rb +592 -0
  100. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/proto_rake.rdoc +127 -0
  101. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/rake.1 +156 -0
  102. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/rakefile.rdoc +622 -0
  103. data/bundle/ruby/2.7.0/gems/rake-13.0.3/doc/rational.rdoc +151 -0
  104. data/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake +27 -0
  105. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/application.rb +824 -0
  106. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/backtrace.rb +24 -0
  107. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/clean.rb +78 -0
  108. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/cloneable.rb +17 -0
  109. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/cpu_counter.rb +107 -0
  110. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/default_loader.rb +15 -0
  111. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/dsl_definition.rb +195 -0
  112. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/early_time.rb +22 -0
  113. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/ext/core.rb +26 -0
  114. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/ext/string.rb +176 -0
  115. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/file_creation_task.rb +25 -0
  116. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/file_list.rb +435 -0
  117. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/file_task.rb +54 -0
  118. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/file_utils.rb +134 -0
  119. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/file_utils_ext.rb +134 -0
  120. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/invocation_chain.rb +57 -0
  121. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/invocation_exception_mixin.rb +17 -0
  122. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/late_time.rb +18 -0
  123. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/linked_list.rb +112 -0
  124. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/loaders/makefile.rb +54 -0
  125. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/multi_task.rb +14 -0
  126. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/name_space.rb +38 -0
  127. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/packagetask.rb +222 -0
  128. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/phony.rb +16 -0
  129. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/private_reader.rb +21 -0
  130. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/promise.rb +100 -0
  131. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/pseudo_status.rb +30 -0
  132. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/rake_module.rb +67 -0
  133. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/rake_test_loader.rb +27 -0
  134. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/rule_recursion_overflow_error.rb +20 -0
  135. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/scope.rb +43 -0
  136. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task.rb +434 -0
  137. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task_argument_error.rb +8 -0
  138. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task_arguments.rb +109 -0
  139. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/task_manager.rb +331 -0
  140. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/tasklib.rb +12 -0
  141. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/testtask.rb +189 -0
  142. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/thread_history_display.rb +49 -0
  143. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/thread_pool.rb +163 -0
  144. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/trace_output.rb +23 -0
  145. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/version.rb +10 -0
  146. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake/win32.rb +51 -0
  147. data/bundle/ruby/2.7.0/gems/rake-13.0.3/lib/rake.rb +71 -0
  148. data/bundle/ruby/2.7.0/gems/rake-13.0.3/rake.gemspec +43 -0
  149. data/bundle/ruby/2.7.0/gems/rspec-3.12.0/LICENSE.md +27 -0
  150. data/bundle/ruby/2.7.0/gems/rspec-3.12.0/README.md +47 -0
  151. data/bundle/ruby/2.7.0/gems/rspec-3.12.0/lib/rspec/version.rb +5 -0
  152. data/bundle/ruby/2.7.0/gems/rspec-3.12.0/lib/rspec.rb +3 -0
  153. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/.document +5 -0
  154. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/.yardopts +8 -0
  155. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/Changelog.md +2360 -0
  156. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/LICENSE.md +26 -0
  157. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/README.md +384 -0
  158. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/exe/rspec +4 -0
  159. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/autorun.rb +3 -0
  160. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/backtrace_formatter.rb +65 -0
  161. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/coordinator.rb +62 -0
  162. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/example_minimizer.rb +173 -0
  163. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/fork_runner.rb +138 -0
  164. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/server.rb +61 -0
  165. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_command.rb +126 -0
  166. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/shell_runner.rb +73 -0
  167. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/utilities.rb +69 -0
  168. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/configuration.rb +2385 -0
  169. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/configuration_options.rb +233 -0
  170. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/did_you_mean.rb +46 -0
  171. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/drb.rb +120 -0
  172. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/dsl.rb +98 -0
  173. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb +666 -0
  174. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb +905 -0
  175. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/example_status_persister.rb +235 -0
  176. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/filter_manager.rb +231 -0
  177. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/flat_map.rb +20 -0
  178. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_bisect_formatter.rb +45 -0
  179. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb +70 -0
  180. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_text_formatter.rb +75 -0
  181. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/bisect_drb_formatter.rb +29 -0
  182. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/bisect_progress_formatter.rb +157 -0
  183. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/console_codes.rb +76 -0
  184. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
  185. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/documentation_formatter.rb +102 -0
  186. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/exception_presenter.rb +525 -0
  187. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/failure_list_formatter.rb +23 -0
  188. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
  189. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/helpers.rb +118 -0
  190. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/html_formatter.rb +153 -0
  191. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/html_printer.rb +412 -0
  192. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/html_snippet_extractor.rb +120 -0
  193. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/json_formatter.rb +102 -0
  194. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/profile_formatter.rb +68 -0
  195. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/progress_formatter.rb +29 -0
  196. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/protocol.rb +182 -0
  197. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/snippet_extractor.rb +134 -0
  198. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
  199. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters.rb +279 -0
  200. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb +646 -0
  201. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/invocations.rb +87 -0
  202. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/memoized_helpers.rb +580 -0
  203. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb +498 -0
  204. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata_filter.rb +255 -0
  205. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
  206. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
  207. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
  208. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/mocking_adapters/null.rb +14 -0
  209. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/mocking_adapters/rr.rb +31 -0
  210. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
  211. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/notifications.rb +521 -0
  212. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/option_parser.rb +323 -0
  213. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/ordering.rb +169 -0
  214. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/output_wrapper.rb +29 -0
  215. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/pending.rb +157 -0
  216. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/profiler.rb +34 -0
  217. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer/.rspec +1 -0
  218. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer/spec/spec_helper.rb +98 -0
  219. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/project_initializer.rb +48 -0
  220. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/rake_task.rb +188 -0
  221. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/reporter.rb +265 -0
  222. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/ruby_project.rb +53 -0
  223. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb +212 -0
  224. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/sandbox.rb +37 -0
  225. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/set.rb +54 -0
  226. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_context.rb +55 -0
  227. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/shared_example_group.rb +271 -0
  228. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/shell_escape.rb +49 -0
  229. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
  230. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/version.rb +9 -0
  231. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/warnings.rb +40 -0
  232. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core/world.rb +287 -0
  233. data/bundle/ruby/2.7.0/gems/rspec-core-3.12.0/lib/rspec/core.rb +212 -0
  234. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/.document +5 -0
  235. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/.yardopts +6 -0
  236. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/Changelog.md +1294 -0
  237. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/LICENSE.md +25 -0
  238. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/README.md +320 -0
  239. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
  240. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/configuration.rb +230 -0
  241. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/expectation_target.rb +163 -0
  242. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/fail_with.rb +39 -0
  243. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/failure_aggregator.rb +229 -0
  244. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/handler.rb +182 -0
  245. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/minitest_integration.rb +58 -0
  246. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/syntax.rb +132 -0
  247. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations/version.rb +8 -0
  248. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/expectations.rb +82 -0
  249. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/aliased_matcher.rb +116 -0
  250. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/all.rb +86 -0
  251. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/base_matcher.rb +198 -0
  252. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/be.rb +191 -0
  253. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/be_between.rb +77 -0
  254. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/be_instance_of.rb +26 -0
  255. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/be_kind_of.rb +20 -0
  256. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/be_within.rb +72 -0
  257. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/change.rb +450 -0
  258. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/compound.rb +290 -0
  259. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/contain_exactly.rb +310 -0
  260. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/count_expectation.rb +169 -0
  261. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/cover.rb +24 -0
  262. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/eq.rb +40 -0
  263. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/eql.rb +34 -0
  264. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/equal.rb +81 -0
  265. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/exist.rb +90 -0
  266. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/has.rb +167 -0
  267. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
  268. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/include.rb +206 -0
  269. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/match.rb +106 -0
  270. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/operators.rb +128 -0
  271. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/output.rb +207 -0
  272. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/raise_error.rb +271 -0
  273. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/respond_to.rb +200 -0
  274. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/satisfy.rb +60 -0
  275. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
  276. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/throw_symbol.rb +138 -0
  277. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in/yield.rb +375 -0
  278. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/built_in.rb +53 -0
  279. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/composable.rb +171 -0
  280. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/dsl.rb +545 -0
  281. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/english_phrasing.rb +58 -0
  282. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +82 -0
  283. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/fail_matchers.rb +42 -0
  284. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/generated_descriptions.rb +41 -0
  285. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/matcher_delegator.rb +35 -0
  286. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers/matcher_protocol.rb +105 -0
  287. data/bundle/ruby/2.7.0/gems/rspec-expectations-3.12.1/lib/rspec/matchers.rb +1044 -0
  288. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/.document +5 -0
  289. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/.yardopts +6 -0
  290. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/Changelog.md +1227 -0
  291. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/LICENSE.md +25 -0
  292. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/README.md +463 -0
  293. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/chain.rb +111 -0
  294. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
  295. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/expect_chain_chain.rb +31 -0
  296. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/expectation_chain.rb +50 -0
  297. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
  298. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/proxy.rb +116 -0
  299. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/recorder.rb +295 -0
  300. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/stub_chain.rb +51 -0
  301. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance/stub_chain_chain.rb +23 -0
  302. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/any_instance.rb +11 -0
  303. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/argument_list_matcher.rb +115 -0
  304. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/argument_matchers.rb +322 -0
  305. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/configuration.rb +212 -0
  306. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/error_generator.rb +390 -0
  307. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/example_methods.rb +434 -0
  308. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/instance_method_stasher.rb +146 -0
  309. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/marshal_extension.rb +41 -0
  310. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
  311. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/matchers/have_received.rb +134 -0
  312. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/matchers/receive.rb +133 -0
  313. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/matchers/receive_message_chain.rb +82 -0
  314. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/matchers/receive_messages.rb +77 -0
  315. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/message_chain.rb +87 -0
  316. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/message_expectation.rb +820 -0
  317. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/method_double.rb +309 -0
  318. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/method_reference.rb +214 -0
  319. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/minitest_integration.rb +68 -0
  320. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/mutate_const.rb +339 -0
  321. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/object_reference.rb +149 -0
  322. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/order_group.rb +81 -0
  323. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/proxy.rb +519 -0
  324. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/space.rb +238 -0
  325. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/standalone.rb +3 -0
  326. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/syntax.rb +325 -0
  327. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/targets.rb +124 -0
  328. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/test_double.rb +171 -0
  329. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/verifying_double.rb +121 -0
  330. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/verifying_message_expectation.rb +55 -0
  331. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/verifying_proxy.rb +220 -0
  332. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks/version.rb +9 -0
  333. data/bundle/ruby/2.7.0/gems/rspec-mocks-3.12.1/lib/rspec/mocks.rb +133 -0
  334. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/Changelog.md +364 -0
  335. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/LICENSE.md +23 -0
  336. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/README.md +40 -0
  337. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/caller_filter.rb +83 -0
  338. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/comparable_version.rb +46 -0
  339. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/differ.rb +215 -0
  340. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/directory_maker.rb +63 -0
  341. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/encoded_string.rb +161 -0
  342. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
  343. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/hunk_generator.rb +47 -0
  344. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/matcher_definition.rb +42 -0
  345. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/method_signature_verifier.rb +438 -0
  346. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/mutex.rb +73 -0
  347. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/object_formatter.rb +275 -0
  348. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/recursive_const_methods.rb +76 -0
  349. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/reentrant_mutex.rb +78 -0
  350. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/ruby_features.rb +198 -0
  351. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/source/location.rb +21 -0
  352. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/source/node.rb +110 -0
  353. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/source/token.rb +94 -0
  354. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/source.rb +85 -0
  355. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/deprecation_helpers.rb +48 -0
  356. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/diff_helpers.rb +31 -0
  357. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/formatting_support.rb +9 -0
  358. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/in_sub_process.rb +67 -0
  359. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/library_wide_checks.rb +150 -0
  360. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/shell_out.rb +105 -0
  361. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/stderr_splitter.rb +75 -0
  362. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/string_matcher.rb +45 -0
  363. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/with_isolated_directory.rb +13 -0
  364. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
  365. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/spec.rb +82 -0
  366. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/version.rb +7 -0
  367. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/warnings.rb +39 -0
  368. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support/with_keywords_when_needed.rb +33 -0
  369. data/bundle/ruby/2.7.0/gems/rspec-support-3.12.0/lib/rspec/support.rb +154 -0
  370. data/bundle/ruby/2.7.0/specifications/diff-lcs-1.5.0.gemspec +50 -0
  371. data/bundle/ruby/2.7.0/specifications/rake-13.0.3.gemspec +26 -0
  372. data/bundle/ruby/2.7.0/specifications/rspec-3.12.0.gemspec +39 -0
  373. data/bundle/ruby/2.7.0/specifications/rspec-core-3.12.0.gemspec +53 -0
  374. data/bundle/ruby/2.7.0/specifications/rspec-expectations-3.12.1.gemspec +44 -0
  375. data/bundle/ruby/2.7.0/specifications/rspec-mocks-3.12.1.gemspec +44 -0
  376. data/bundle/ruby/2.7.0/specifications/rspec-support-3.12.0.gemspec +36 -0
  377. data/lib/takuya/lvm_snapshot/version.rb +7 -0
  378. data/lib/takuya/lvm_snapshot.rb +111 -0
  379. data/takuya-lvm-snapshot.gemspec +34 -0
  380. metadata +424 -0
@@ -0,0 +1,545 @@
1
+ RSpec::Support.require_rspec_support "with_keywords_when_needed"
2
+
3
+ module RSpec
4
+ module Matchers
5
+ # Defines the custom matcher DSL.
6
+ module DSL
7
+ # Defines a matcher alias. The returned matcher's `description` will be overriden
8
+ # to reflect the phrasing of the new name, which will be used in failure messages
9
+ # when passed as an argument to another matcher in a composed matcher expression.
10
+ #
11
+ # @example
12
+ # RSpec::Matchers.alias_matcher :a_list_that_sums_to, :sum_to
13
+ # sum_to(3).description # => "sum to 3"
14
+ # a_list_that_sums_to(3).description # => "a list that sums to 3"
15
+ #
16
+ # @example
17
+ # RSpec::Matchers.alias_matcher :a_list_sorted_by, :be_sorted_by do |description|
18
+ # description.sub("be sorted by", "a list sorted by")
19
+ # end
20
+ #
21
+ # be_sorted_by(:age).description # => "be sorted by age"
22
+ # a_list_sorted_by(:age).description # => "a list sorted by age"
23
+ #
24
+ # @param new_name [Symbol] the new name for the matcher
25
+ # @param old_name [Symbol] the original name for the matcher
26
+ # @param options [Hash] options for the aliased matcher
27
+ # @option options [Class] :klass the ruby class to use as the decorator. (Not normally used).
28
+ # @yield [String] optional block that, when given, is used to define the overriden
29
+ # logic. The yielded arg is the original description or failure message. If no
30
+ # block is provided, a default override is used based on the old and new names.
31
+ # @see RSpec::Matchers
32
+ def alias_matcher(new_name, old_name, options={}, &description_override)
33
+ description_override ||= lambda do |old_desc|
34
+ old_desc.gsub(EnglishPhrasing.split_words(old_name), EnglishPhrasing.split_words(new_name))
35
+ end
36
+ klass = options.fetch(:klass) { AliasedMatcher }
37
+
38
+ define_method(new_name) do |*args, &block|
39
+ matcher = __send__(old_name, *args, &block)
40
+ matcher.matcher_name = new_name if matcher.respond_to?(:matcher_name=)
41
+ klass.new(matcher, description_override)
42
+ end
43
+ ruby2_keywords new_name if respond_to?(:ruby2_keywords, true)
44
+ end
45
+
46
+ # Defines a negated matcher. The returned matcher's `description` and `failure_message`
47
+ # will be overriden to reflect the phrasing of the new name, and the match logic will
48
+ # be based on the original matcher but negated.
49
+ #
50
+ # @example
51
+ # RSpec::Matchers.define_negated_matcher :exclude, :include
52
+ # include(1, 2).description # => "include 1 and 2"
53
+ # exclude(1, 2).description # => "exclude 1 and 2"
54
+ #
55
+ # @param negated_name [Symbol] the name for the negated matcher
56
+ # @param base_name [Symbol] the name of the original matcher that will be negated
57
+ # @yield [String] optional block that, when given, is used to define the overriden
58
+ # logic. The yielded arg is the original description or failure message. If no
59
+ # block is provided, a default override is used based on the old and new names.
60
+ # @see RSpec::Matchers
61
+ def define_negated_matcher(negated_name, base_name, &description_override)
62
+ alias_matcher(negated_name, base_name, :klass => AliasedNegatedMatcher, &description_override)
63
+ end
64
+
65
+ # Defines a custom matcher.
66
+ #
67
+ # @param name [Symbol] the name for the matcher
68
+ # @yield [Object] block that is used to define the matcher.
69
+ # The block is evaluated in the context of your custom matcher class.
70
+ # When args are passed to your matcher, they will be yielded here,
71
+ # usually representing the expected value(s).
72
+ # @see RSpec::Matchers
73
+ def define(name, &declarations)
74
+ warn_about_block_args(name, declarations)
75
+ define_method name do |*expected, &block_arg|
76
+ RSpec::Matchers::DSL::Matcher.new(name, declarations, self, *expected, &block_arg)
77
+ end
78
+ end
79
+ alias_method :matcher, :define
80
+
81
+ private
82
+
83
+ if Proc.method_defined?(:parameters)
84
+ def warn_about_block_args(name, declarations)
85
+ declarations.parameters.each do |type, arg_name|
86
+ next unless type == :block
87
+ RSpec.warning("Your `#{name}` custom matcher receives a block argument (`#{arg_name}`), " \
88
+ "but due to limitations in ruby, RSpec cannot provide the block. Instead, " \
89
+ "use the `block_arg` method to access the block")
90
+ end
91
+ end
92
+ else
93
+ # :nocov:
94
+ def warn_about_block_args(*)
95
+ # There's no way to detect block params on 1.8 since the method reflection APIs don't expose it
96
+ end
97
+ # :nocov:
98
+ end
99
+
100
+ RSpec.configure { |c| c.extend self } if RSpec.respond_to?(:configure)
101
+
102
+ # Contains the methods that are available from within the
103
+ # `RSpec::Matchers.define` DSL for creating custom matchers.
104
+ module Macros
105
+ # Stores the block that is used to determine whether this matcher passes
106
+ # or fails. The block should return a boolean value. When the matcher is
107
+ # passed to `expect(...).to` and the block returns `true`, then the expectation
108
+ # passes. Similarly, when the matcher is passed to `expect(...).not_to` and the
109
+ # block returns `false`, then the expectation passes.
110
+ #
111
+ # @example
112
+ #
113
+ # RSpec::Matchers.define :be_even do
114
+ # match do |actual|
115
+ # actual.even?
116
+ # end
117
+ # end
118
+ #
119
+ # expect(4).to be_even # passes
120
+ # expect(3).not_to be_even # passes
121
+ # expect(3).to be_even # fails
122
+ # expect(4).not_to be_even # fails
123
+ #
124
+ # By default the match block will swallow expectation errors (e.g.
125
+ # caused by using an expectation such as `expect(1).to eq 2`), if you
126
+ # wish to allow these to bubble up, pass in the option
127
+ # `:notify_expectation_failures => true`.
128
+ #
129
+ # @param [Hash] options for defining the behavior of the match block.
130
+ # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`)
131
+ def match(options={}, &match_block)
132
+ define_user_override(:matches?, match_block) do |actual|
133
+ @actual = actual
134
+ RSpec::Support.with_failure_notifier(RAISE_NOTIFIER) do
135
+ begin
136
+ super(*actual_arg_for(match_block))
137
+ rescue RSpec::Expectations::ExpectationNotMetError
138
+ raise if options[:notify_expectation_failures]
139
+ false
140
+ end
141
+ end
142
+ end
143
+ end
144
+
145
+ # @private
146
+ RAISE_NOTIFIER = Proc.new { |err, _opts| raise err }
147
+
148
+ # Use this to define the block for a negative expectation (`expect(...).not_to`)
149
+ # when the positive and negative forms require different handling. This
150
+ # is rarely necessary, but can be helpful, for example, when specifying
151
+ # asynchronous processes that require different timeouts.
152
+ #
153
+ # By default the match block will swallow expectation errors (e.g.
154
+ # caused by using an expectation such as `expect(1).to eq 2`), if you
155
+ # wish to allow these to bubble up, pass in the option
156
+ # `:notify_expectation_failures => true`.
157
+ #
158
+ # @param [Hash] options for defining the behavior of the match block.
159
+ # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`)
160
+ def match_when_negated(options={}, &match_block)
161
+ define_user_override(:does_not_match?, match_block) do |actual|
162
+ begin
163
+ @actual = actual
164
+ RSpec::Support.with_failure_notifier(RAISE_NOTIFIER) do
165
+ super(*actual_arg_for(match_block))
166
+ end
167
+ rescue RSpec::Expectations::ExpectationNotMetError
168
+ raise if options[:notify_expectation_failures]
169
+ false
170
+ end
171
+ end
172
+ end
173
+
174
+ # Use this instead of `match` when the block will raise an exception
175
+ # rather than returning false to indicate a failure.
176
+ #
177
+ # @example
178
+ #
179
+ # RSpec::Matchers.define :accept_as_valid do |candidate_address|
180
+ # match_unless_raises ValidationException do |validator|
181
+ # validator.validate(candidate_address)
182
+ # end
183
+ # end
184
+ #
185
+ # expect(email_validator).to accept_as_valid("person@company.com")
186
+ #
187
+ # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`)
188
+ def match_unless_raises(expected_exception=Exception, &match_block)
189
+ define_user_override(:matches?, match_block) do |actual|
190
+ @actual = actual
191
+ begin
192
+ super(*actual_arg_for(match_block))
193
+ rescue expected_exception => @rescued_exception
194
+ false
195
+ else
196
+ true
197
+ end
198
+ end
199
+ end
200
+
201
+ # Customizes the failure messsage to use when this matcher is
202
+ # asked to positively match. Only use this when the message
203
+ # generated by default doesn't suit your needs.
204
+ #
205
+ # @example
206
+ #
207
+ # RSpec::Matchers.define :have_strength do |expected|
208
+ # match { your_match_logic }
209
+ #
210
+ # failure_message do |actual|
211
+ # "Expected strength of #{expected}, but had #{actual.strength}"
212
+ # end
213
+ # end
214
+ #
215
+ # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`)
216
+ def failure_message(&definition)
217
+ define_user_override(__method__, definition)
218
+ end
219
+
220
+ # Customize the failure messsage to use when this matcher is asked
221
+ # to negatively match. Only use this when the message generated by
222
+ # default doesn't suit your needs.
223
+ #
224
+ # @example
225
+ #
226
+ # RSpec::Matchers.define :have_strength do |expected|
227
+ # match { your_match_logic }
228
+ #
229
+ # failure_message_when_negated do |actual|
230
+ # "Expected not to have strength of #{expected}, but did"
231
+ # end
232
+ # end
233
+ #
234
+ # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`)
235
+ def failure_message_when_negated(&definition)
236
+ define_user_override(__method__, definition)
237
+ end
238
+
239
+ # Customize the description to use for one-liners. Only use this when
240
+ # the description generated by default doesn't suit your needs.
241
+ #
242
+ # @example
243
+ #
244
+ # RSpec::Matchers.define :qualify_for do |expected|
245
+ # match { your_match_logic }
246
+ #
247
+ # description do
248
+ # "qualify for #{expected}"
249
+ # end
250
+ # end
251
+ #
252
+ # @yield [Object] actual the actual object (i.e. the value wrapped by `expect`)
253
+ def description(&definition)
254
+ define_user_override(__method__, definition)
255
+ end
256
+
257
+ # Tells the matcher to diff the actual and expected values in the failure
258
+ # message.
259
+ def diffable
260
+ define_method(:diffable?) { true }
261
+ end
262
+
263
+ # Declares that the matcher can be used in a block expectation.
264
+ # Users will not be able to use your matcher in a block
265
+ # expectation without declaring this.
266
+ # (e.g. `expect { do_something }.to matcher`).
267
+ def supports_block_expectations
268
+ define_method(:supports_block_expectations?) { true }
269
+ end
270
+
271
+ # Convenience for defining methods on this matcher to create a fluent
272
+ # interface. The trick about fluent interfaces is that each method must
273
+ # return self in order to chain methods together. `chain` handles that
274
+ # for you. If the method is invoked and the
275
+ # `include_chain_clauses_in_custom_matcher_descriptions` config option
276
+ # hash been enabled, the chained method name and args will be added to the
277
+ # default description and failure message.
278
+ #
279
+ # In the common case where you just want the chained method to store some
280
+ # value(s) for later use (e.g. in `match`), you can provide one or more
281
+ # attribute names instead of a block; the chained method will store its
282
+ # arguments in instance variables with those names, and the values will
283
+ # be exposed via getters.
284
+ #
285
+ # @example
286
+ #
287
+ # RSpec::Matchers.define :have_errors_on do |key|
288
+ # chain :with do |message|
289
+ # @message = message
290
+ # end
291
+ #
292
+ # match do |actual|
293
+ # actual.errors[key] == @message
294
+ # end
295
+ # end
296
+ #
297
+ # expect(minor).to have_errors_on(:age).with("Not old enough to participate")
298
+ def chain(method_name, *attr_names, &definition)
299
+ unless block_given? ^ attr_names.any?
300
+ raise ArgumentError, "You must pass either a block or some attribute names (but not both) to `chain`."
301
+ end
302
+
303
+ definition = assign_attributes(attr_names) if attr_names.any?
304
+
305
+ define_user_override(method_name, definition) do |*args, &block|
306
+ super(*args, &block)
307
+ @chained_method_clauses.push([method_name, args])
308
+ self
309
+ end
310
+ end
311
+
312
+ def assign_attributes(attr_names)
313
+ attr_reader(*attr_names)
314
+ private(*attr_names)
315
+
316
+ lambda do |*attr_values|
317
+ attr_names.zip(attr_values) do |attr_name, attr_value|
318
+ instance_variable_set(:"@#{attr_name}", attr_value)
319
+ end
320
+ end
321
+ end
322
+
323
+ # assign_attributes isn't defined in the private section below because
324
+ # that makes MRI 1.9.2 emit a warning about private attributes.
325
+ private :assign_attributes
326
+
327
+ private
328
+
329
+ # Does the following:
330
+ #
331
+ # - Defines the named method using a user-provided block
332
+ # in @user_method_defs, which is included as an ancestor
333
+ # in the singleton class in which we eval the `define` block.
334
+ # - Defines an overriden definition for the same method
335
+ # usign the provided `our_def` block.
336
+ # - Provides a default `our_def` block for the common case
337
+ # of needing to call the user's definition with `@actual`
338
+ # as an arg, but only if their block's arity can handle it.
339
+ #
340
+ # This compiles the user block into an actual method, allowing
341
+ # them to use normal method constructs like `return`
342
+ # (e.g. for an early guard statement), while allowing us to define
343
+ # an override that can provide the wrapped handling
344
+ # (e.g. assigning `@actual`, rescueing errors, etc) and
345
+ # can `super` to the user's definition.
346
+ def define_user_override(method_name, user_def, &our_def)
347
+ @user_method_defs.__send__(:define_method, method_name, &user_def)
348
+ our_def ||= lambda { super(*actual_arg_for(user_def)) }
349
+ define_method(method_name, &our_def)
350
+ end
351
+
352
+ # Defines deprecated macro methods from RSpec 2 for backwards compatibility.
353
+ # @deprecated Use the methods from {Macros} instead.
354
+ module Deprecated
355
+ # @deprecated Use {Macros#match} instead.
356
+ def match_for_should(&definition)
357
+ RSpec.deprecate("`match_for_should`", :replacement => "`match`")
358
+ match(&definition)
359
+ end
360
+
361
+ # @deprecated Use {Macros#match_when_negated} instead.
362
+ def match_for_should_not(&definition)
363
+ RSpec.deprecate("`match_for_should_not`", :replacement => "`match_when_negated`")
364
+ match_when_negated(&definition)
365
+ end
366
+
367
+ # @deprecated Use {Macros#failure_message} instead.
368
+ def failure_message_for_should(&definition)
369
+ RSpec.deprecate("`failure_message_for_should`", :replacement => "`failure_message`")
370
+ failure_message(&definition)
371
+ end
372
+
373
+ # @deprecated Use {Macros#failure_message_when_negated} instead.
374
+ def failure_message_for_should_not(&definition)
375
+ RSpec.deprecate("`failure_message_for_should_not`", :replacement => "`failure_message_when_negated`")
376
+ failure_message_when_negated(&definition)
377
+ end
378
+ end
379
+ end
380
+
381
+ # Defines default implementations of the matcher
382
+ # protocol methods for custom matchers. You can
383
+ # override any of these using the {RSpec::Matchers::DSL::Macros Macros} methods
384
+ # from within an `RSpec::Matchers.define` block.
385
+ module DefaultImplementations
386
+ include BuiltIn::BaseMatcher::DefaultFailureMessages
387
+
388
+ # @api private
389
+ # Used internally by objects returns by `should` and `should_not`.
390
+ def diffable?
391
+ false
392
+ end
393
+
394
+ # The default description.
395
+ def description
396
+ english_name = EnglishPhrasing.split_words(name)
397
+ expected_list = EnglishPhrasing.list(expected)
398
+ "#{english_name}#{expected_list}#{chained_method_clause_sentences}"
399
+ end
400
+
401
+ # Matchers do not support block expectations by default. You
402
+ # must opt-in.
403
+ def supports_block_expectations?
404
+ false
405
+ end
406
+
407
+ def supports_value_expectations?
408
+ true
409
+ end
410
+
411
+ # Most matchers do not expect call stack jumps.
412
+ def expects_call_stack_jump?
413
+ false
414
+ end
415
+
416
+ private
417
+
418
+ def chained_method_clause_sentences
419
+ return '' unless Expectations.configuration.include_chain_clauses_in_custom_matcher_descriptions?
420
+
421
+ @chained_method_clauses.map do |(method_name, method_args)|
422
+ english_name = EnglishPhrasing.split_words(method_name)
423
+ arg_list = EnglishPhrasing.list(method_args)
424
+ " #{english_name}#{arg_list}"
425
+ end.join
426
+ end
427
+ end
428
+
429
+ # The class used for custom matchers. The block passed to
430
+ # `RSpec::Matchers.define` will be evaluated in the context
431
+ # of the singleton class of an instance, and will have the
432
+ # {RSpec::Matchers::DSL::Macros Macros} methods available.
433
+ class Matcher
434
+ # Provides default implementations for the matcher protocol methods.
435
+ include DefaultImplementations
436
+
437
+ # Allows expectation expressions to be used in the match block.
438
+ include RSpec::Matchers
439
+
440
+ # Supports the matcher composability features of RSpec 3+.
441
+ include Composable
442
+
443
+ # Makes the macro methods available to an `RSpec::Matchers.define` block.
444
+ extend Macros
445
+ extend Macros::Deprecated
446
+
447
+ # Exposes the value being matched against -- generally the object
448
+ # object wrapped by `expect`.
449
+ attr_reader :actual
450
+
451
+ # Exposes the exception raised during the matching by `match_unless_raises`.
452
+ # Could be useful to extract details for a failure message.
453
+ attr_reader :rescued_exception
454
+
455
+ # The block parameter used in the expectation
456
+ attr_reader :block_arg
457
+
458
+ # The name of the matcher.
459
+ attr_reader :name
460
+
461
+ # @api private
462
+ def initialize(name, declarations, matcher_execution_context, *expected, &block_arg)
463
+ @name = name
464
+ @actual = nil
465
+ @expected_as_array = expected
466
+ @matcher_execution_context = matcher_execution_context
467
+ @chained_method_clauses = []
468
+ @block_arg = block_arg
469
+
470
+ klass = class << self
471
+ # See `Macros#define_user_override` above, for an explanation.
472
+ include(@user_method_defs = Module.new)
473
+ self
474
+ end
475
+ RSpec::Support::WithKeywordsWhenNeeded.class_exec(klass, *expected, &declarations)
476
+ end
477
+
478
+ # Provides the expected value. This will return an array if
479
+ # multiple arguments were passed to the matcher; otherwise it
480
+ # will return a single value.
481
+ # @see #expected_as_array
482
+ def expected
483
+ if expected_as_array.size == 1
484
+ expected_as_array[0]
485
+ else
486
+ expected_as_array
487
+ end
488
+ end
489
+
490
+ # Returns the expected value as an an array. This exists primarily
491
+ # to aid in upgrading from RSpec 2.x, since in RSpec 2, `expected`
492
+ # always returned an array.
493
+ # @see #expected
494
+ attr_reader :expected_as_array
495
+
496
+ # Adds the name (rather than a cryptic hex number)
497
+ # so we can identify an instance of
498
+ # the matcher in error messages (e.g. for `NoMethodError`)
499
+ def inspect
500
+ "#<#{self.class.name} #{name}>"
501
+ end
502
+
503
+ if RUBY_VERSION.to_f >= 1.9
504
+ # Indicates that this matcher responds to messages
505
+ # from the `@matcher_execution_context` as well.
506
+ # Also, supports getting a method object for such methods.
507
+ def respond_to_missing?(method, include_private=false)
508
+ super || @matcher_execution_context.respond_to?(method, include_private)
509
+ end
510
+ else # for 1.8.7
511
+ # :nocov:
512
+ # Indicates that this matcher responds to messages
513
+ # from the `@matcher_execution_context` as well.
514
+ def respond_to?(method, include_private=false)
515
+ super || @matcher_execution_context.respond_to?(method, include_private)
516
+ end
517
+ # :nocov:
518
+ end
519
+
520
+ private
521
+
522
+ def actual_arg_for(block)
523
+ block.arity.zero? ? [] : [@actual]
524
+ end
525
+
526
+ # Takes care of forwarding unhandled messages to the
527
+ # `@matcher_execution_context` (typically the current
528
+ # running `RSpec::Core::Example`). This is needed by
529
+ # rspec-rails so that it can define matchers that wrap
530
+ # Rails' test helper methods, but it's also a useful
531
+ # feature in its own right.
532
+ def method_missing(method, *args, &block)
533
+ if @matcher_execution_context.respond_to?(method)
534
+ @matcher_execution_context.__send__ method, *args, &block
535
+ else
536
+ super(method, *args, &block)
537
+ end
538
+ end
539
+ # The method_missing method should be refactored to pass kw args in RSpec 4
540
+ # then this can be removed
541
+ ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
542
+ end
543
+ end
544
+ end
545
+ end
@@ -0,0 +1,58 @@
1
+ module RSpec
2
+ module Matchers
3
+ # Facilitates converting ruby objects to English phrases.
4
+ module EnglishPhrasing
5
+ # Converts a symbol into an English expression.
6
+ #
7
+ # split_words(:banana_creme_pie) #=> "banana creme pie"
8
+ #
9
+ def self.split_words(sym)
10
+ sym.to_s.tr('_', ' ')
11
+ end
12
+
13
+ # @note The returned string has a leading space except
14
+ # when given an empty list.
15
+ #
16
+ # Converts an object (often a collection of objects)
17
+ # into an English list.
18
+ #
19
+ # list(['banana', 'kiwi', 'mango'])
20
+ # #=> " \"banana\", \"kiwi\", and \"mango\""
21
+ #
22
+ # Given an empty collection, returns the empty string.
23
+ #
24
+ # list([]) #=> ""
25
+ #
26
+ def self.list(obj)
27
+ return " #{RSpec::Support::ObjectFormatter.format(obj)}" if !obj || Struct === obj || Hash === obj
28
+ items = Array(obj).map { |w| RSpec::Support::ObjectFormatter.format(w) }
29
+ case items.length
30
+ when 0
31
+ ""
32
+ when 1
33
+ " #{items[0]}"
34
+ when 2
35
+ " #{items[0]} and #{items[1]}"
36
+ else
37
+ " #{items[0...-1].join(', ')}, and #{items[-1]}"
38
+ end
39
+ end
40
+
41
+ if RUBY_VERSION == '1.8.7'
42
+ # Not sure why, but on travis on 1.8.7 we have gotten these warnings:
43
+ # lib/rspec/matchers/english_phrasing.rb:28: warning: default `to_a' will be obsolete
44
+ # So it appears that `Array` can trigger that (e.g. by calling `to_a` on the passed object?)
45
+ # So here we replace `Kernel#Array` with our own warning-free implementation for 1.8.7.
46
+ # @private
47
+ # rubocop:disable Naming/MethodName
48
+ def self.Array(obj)
49
+ case obj
50
+ when Array then obj
51
+ else [obj]
52
+ end
53
+ end
54
+ # rubocop:enable Naming/MethodName
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,82 @@
1
+ module RSpec
2
+ module Matchers
3
+ # @api private
4
+ # Handles list of expected values when there is a need to render
5
+ # multiple diffs. Also can handle one value.
6
+ class ExpectedsForMultipleDiffs
7
+ # @private
8
+ # Default diff label when there is only one matcher in diff
9
+ # output
10
+ DEFAULT_DIFF_LABEL = "Diff:".freeze
11
+
12
+ # @private
13
+ # Maximum readable matcher description length
14
+ DESCRIPTION_MAX_LENGTH = 65
15
+
16
+ def initialize(expected_list)
17
+ @expected_list = expected_list
18
+ end
19
+
20
+ # @api private
21
+ # Wraps provided expected value in instance of
22
+ # ExpectedForMultipleDiffs. If provided value is already an
23
+ # ExpectedForMultipleDiffs then it just returns it.
24
+ # @param [Any] expected value to be wrapped
25
+ # @return [RSpec::Matchers::ExpectedsForMultipleDiffs]
26
+ def self.from(expected)
27
+ return expected if self === expected
28
+ new([[expected, DEFAULT_DIFF_LABEL]])
29
+ end
30
+
31
+ # @api private
32
+ # Wraps provided matcher list in instance of
33
+ # ExpectedForMultipleDiffs.
34
+ # @param [Array<Any>] matchers list of matchers to wrap
35
+ # @return [RSpec::Matchers::ExpectedsForMultipleDiffs]
36
+ def self.for_many_matchers(matchers)
37
+ new(matchers.map { |m| [m.expected, diff_label_for(m)] })
38
+ end
39
+
40
+ # @api private
41
+ # Returns message with diff(s) appended for provided differ
42
+ # factory and actual value if there are any
43
+ # @param [String] message original failure message
44
+ # @param [Proc] differ
45
+ # @param [Any] actual value
46
+ # @return [String]
47
+ def message_with_diff(message, differ, actual)
48
+ diff = diffs(differ, actual)
49
+ message = "#{message}\n#{diff}" unless diff.empty?
50
+ message
51
+ end
52
+
53
+ private
54
+
55
+ class << self
56
+ private
57
+
58
+ def diff_label_for(matcher)
59
+ "Diff for (#{truncated(RSpec::Support::ObjectFormatter.format(matcher))}):"
60
+ end
61
+
62
+ def truncated(description)
63
+ return description if description.length <= DESCRIPTION_MAX_LENGTH
64
+ description[0...DESCRIPTION_MAX_LENGTH - 3] << "..."
65
+ end
66
+ end
67
+
68
+ def diffs(differ, actual)
69
+ @expected_list.map do |(expected, diff_label)|
70
+ diff = differ.diff(actual, expected)
71
+ next if diff.strip.empty?
72
+ if diff == "\e[0m\n\e[0m"
73
+ "#{diff_label}\n" \
74
+ " <The diff is empty, are your objects producing identical `#inspect` output?>"
75
+ else
76
+ "#{diff_label}#{diff}"
77
+ end
78
+ end.compact.join("\n")
79
+ end
80
+ end
81
+ end
82
+ end