shoulda-matchers 3.1.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +5 -5
  2. data/{MIT-LICENSE → LICENSE} +1 -1
  3. data/README.md +407 -232
  4. data/docs/errors/NonCaseSwappableValueError.md +2 -2
  5. data/lib/shoulda/matchers/action_controller/callback_matcher.rb +7 -80
  6. data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +4 -3
  7. data/lib/shoulda/matchers/action_controller/flash_store.rb +2 -4
  8. data/lib/shoulda/matchers/action_controller/permit_matcher.rb +36 -30
  9. data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +8 -10
  10. data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +7 -9
  11. data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +18 -15
  12. data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +3 -2
  13. data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +3 -3
  14. data/lib/shoulda/matchers/action_controller/route_matcher.rb +88 -29
  15. data/lib/shoulda/matchers/action_controller/route_params.rb +2 -2
  16. data/lib/shoulda/matchers/action_controller/set_flash_matcher.rb +4 -4
  17. data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +3 -3
  18. data/lib/shoulda/matchers/action_controller/set_session_or_flash_matcher.rb +19 -13
  19. data/lib/shoulda/matchers/action_controller.rb +2 -0
  20. data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_changed_value_error.rb +1 -1
  21. data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter.rb +5 -9
  22. data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter_and_validator.rb +2 -2
  23. data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters.rb +1 -1
  24. data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters_and_validators.rb +1 -1
  25. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +42 -39
  26. data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +1 -1
  27. data/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb +52 -26
  28. data/lib/shoulda/matchers/active_model/helpers.rb +2 -2
  29. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +32 -30
  30. data/lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb +2 -1
  31. data/lib/shoulda/matchers/active_model/qualifiers/allow_blank.rb +26 -0
  32. data/lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb +26 -0
  33. data/lib/shoulda/matchers/active_model/qualifiers/ignoring_interference_by_writer.rb +1 -1
  34. data/lib/shoulda/matchers/active_model/qualifiers.rb +2 -0
  35. data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +30 -6
  36. data/lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb +8 -3
  37. data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +31 -16
  38. data/lib/shoulda/matchers/active_model/validate_exclusion_of_matcher.rb +52 -16
  39. data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +137 -84
  40. data/lib/shoulda/matchers/active_model/validate_length_of_matcher.rb +159 -46
  41. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +130 -66
  42. data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +251 -24
  43. data/lib/shoulda/matchers/active_model/validation_matcher/build_description.rb +12 -9
  44. data/lib/shoulda/matchers/active_model/validation_matcher.rb +38 -6
  45. data/lib/shoulda/matchers/active_model/validation_message_finder.rb +2 -4
  46. data/lib/shoulda/matchers/active_model/validator.rb +4 -9
  47. data/lib/shoulda/matchers/active_model.rb +3 -5
  48. data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +10 -7
  49. data/lib/shoulda/matchers/active_record/association_matcher.rb +386 -111
  50. data/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb +5 -2
  51. data/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb +4 -4
  52. data/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb +1 -1
  53. data/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +11 -6
  54. data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +14 -15
  55. data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +30 -8
  56. data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +34 -11
  57. data/lib/shoulda/matchers/active_record/association_matchers/optional_matcher.rb +69 -0
  58. data/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb +1 -1
  59. data/lib/shoulda/matchers/active_record/association_matchers/required_matcher.rb +74 -0
  60. data/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb +3 -2
  61. data/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb +7 -5
  62. data/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb +458 -42
  63. data/lib/shoulda/matchers/active_record/have_attached_matcher.rb +185 -0
  64. data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +63 -23
  65. data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +164 -48
  66. data/lib/shoulda/matchers/active_record/have_implicit_order_column.rb +106 -0
  67. data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +13 -11
  68. data/lib/shoulda/matchers/active_record/have_rich_text_matcher.rb +83 -0
  69. data/lib/shoulda/matchers/active_record/have_secure_token_matcher.rb +132 -0
  70. data/lib/shoulda/matchers/active_record/serialize_matcher.rb +18 -18
  71. data/lib/shoulda/matchers/active_record/uniqueness/test_model_creator.rb +1 -3
  72. data/lib/shoulda/matchers/active_record/uniqueness/test_models.rb +0 -2
  73. data/lib/shoulda/matchers/active_record/uniqueness.rb +1 -1
  74. data/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb +430 -200
  75. data/lib/shoulda/matchers/active_record.rb +28 -20
  76. data/lib/shoulda/matchers/configuration.rb +12 -1
  77. data/lib/shoulda/matchers/doublespeak/double.rb +1 -1
  78. data/lib/shoulda/matchers/doublespeak/double_collection.rb +3 -3
  79. data/lib/shoulda/matchers/doublespeak/double_implementation_registry.rb +8 -5
  80. data/lib/shoulda/matchers/doublespeak/object_double.rb +6 -2
  81. data/lib/shoulda/matchers/doublespeak/stub_implementation.rb +1 -5
  82. data/lib/shoulda/matchers/doublespeak/world.rb +2 -2
  83. data/lib/shoulda/matchers/doublespeak.rb +2 -1
  84. data/lib/shoulda/matchers/error.rb +1 -1
  85. data/lib/shoulda/matchers/independent/delegate_method_matcher.rb +109 -29
  86. data/lib/shoulda/matchers/independent.rb +2 -2
  87. data/lib/shoulda/matchers/integrations/configuration.rb +8 -4
  88. data/lib/shoulda/matchers/integrations/libraries/action_controller.rb +1 -1
  89. data/lib/shoulda/matchers/integrations/libraries/rails.rb +2 -2
  90. data/lib/shoulda/matchers/integrations/test_frameworks/active_support_test_case.rb +1 -1
  91. data/lib/shoulda/matchers/integrations/test_frameworks/minitest_4.rb +1 -1
  92. data/lib/shoulda/matchers/integrations/test_frameworks/minitest_5.rb +1 -1
  93. data/lib/shoulda/matchers/integrations/test_frameworks/missing_test_framework.rb +1 -1
  94. data/lib/shoulda/matchers/integrations/test_frameworks/test_unit.rb +1 -1
  95. data/lib/shoulda/matchers/rails_shim.rb +172 -51
  96. data/lib/shoulda/matchers/routing.rb +2 -2
  97. data/lib/shoulda/matchers/util/word_wrap.rb +17 -12
  98. data/lib/shoulda/matchers/util.rb +39 -5
  99. data/lib/shoulda/matchers/version.rb +1 -1
  100. data/lib/shoulda/matchers/warn.rb +4 -3
  101. data/shoulda-matchers.gemspec +33 -15
  102. metadata +31 -338
  103. data/.gitignore +0 -12
  104. data/.hound.yml +0 -3
  105. data/.hound_config/ruby.yml +0 -12
  106. data/.travis.yml +0 -19
  107. data/.yardopts +0 -10
  108. data/Appraisals +0 -73
  109. data/CONTRIBUTING.md +0 -101
  110. data/Gemfile +0 -15
  111. data/Gemfile.lock +0 -70
  112. data/NEWS.md +0 -986
  113. data/Rakefile +0 -39
  114. data/custom_plan.rb +0 -88
  115. data/doc_config/gh-pages/index.html.erb +0 -9
  116. data/doc_config/yard/setup.rb +0 -22
  117. data/doc_config/yard/templates/default/fulldoc/html/css/bootstrap.css +0 -5967
  118. data/doc_config/yard/templates/default/fulldoc/html/css/full_list.css +0 -12
  119. data/doc_config/yard/templates/default/fulldoc/html/css/global.css +0 -62
  120. data/doc_config/yard/templates/default/fulldoc/html/css/solarized.css +0 -69
  121. data/doc_config/yard/templates/default/fulldoc/html/css/style.css +0 -312
  122. data/doc_config/yard/templates/default/fulldoc/html/full_list.erb +0 -32
  123. data/doc_config/yard/templates/default/fulldoc/html/full_list_class.erb +0 -1
  124. data/doc_config/yard/templates/default/fulldoc/html/full_list_method.erb +0 -8
  125. data/doc_config/yard/templates/default/fulldoc/html/js/app.js +0 -298
  126. data/doc_config/yard/templates/default/fulldoc/html/js/full_list.js +0 -1
  127. data/doc_config/yard/templates/default/fulldoc/html/js/jquery.stickyheaders.js +0 -289
  128. data/doc_config/yard/templates/default/fulldoc/html/js/underscore.min.js +0 -6
  129. data/doc_config/yard/templates/default/fulldoc/html/setup.rb +0 -8
  130. data/doc_config/yard/templates/default/layout/html/breadcrumb.erb +0 -14
  131. data/doc_config/yard/templates/default/layout/html/fonts.erb +0 -1
  132. data/doc_config/yard/templates/default/layout/html/footer.erb +0 -6
  133. data/doc_config/yard/templates/default/layout/html/layout.erb +0 -23
  134. data/doc_config/yard/templates/default/layout/html/search.erb +0 -13
  135. data/doc_config/yard/templates/default/layout/html/setup.rb +0 -40
  136. data/doc_config/yard/templates/default/method_details/html/source.erb +0 -10
  137. data/doc_config/yard/templates/default/module/html/box_info.erb +0 -31
  138. data/gemfiles/4.0.0.gemfile +0 -38
  139. data/gemfiles/4.0.0.gemfile.lock +0 -223
  140. data/gemfiles/4.0.1.gemfile +0 -38
  141. data/gemfiles/4.0.1.gemfile.lock +0 -225
  142. data/gemfiles/4.1.gemfile +0 -38
  143. data/gemfiles/4.1.gemfile.lock +0 -220
  144. data/gemfiles/4.2.gemfile +0 -38
  145. data/gemfiles/4.2.gemfile.lock +0 -243
  146. data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +0 -159
  147. data/lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb +0 -37
  148. data/script/SUPPORTED_VERSIONS +0 -1
  149. data/script/install_gems_in_all_appraisals +0 -14
  150. data/script/run_all_tests +0 -14
  151. data/script/update_gem_in_all_appraisals +0 -15
  152. data/script/update_gems_in_all_appraisals +0 -14
  153. data/spec/acceptance/active_model_integration_spec.rb +0 -23
  154. data/spec/acceptance/independent_matchers_spec.rb +0 -125
  155. data/spec/acceptance/multiple_libraries_integration_spec.rb +0 -55
  156. data/spec/acceptance/rails_integration_spec.rb +0 -156
  157. data/spec/acceptance_spec_helper.rb +0 -23
  158. data/spec/doublespeak_spec_helper.rb +0 -2
  159. data/spec/report_warnings.rb +0 -7
  160. data/spec/spec_helper.rb +0 -21
  161. data/spec/support/acceptance/adds_shoulda_matchers_to_project.rb +0 -133
  162. data/spec/support/acceptance/helpers/active_model_helpers.rb +0 -11
  163. data/spec/support/acceptance/helpers/array_helpers.rb +0 -13
  164. data/spec/support/acceptance/helpers/base_helpers.rb +0 -19
  165. data/spec/support/acceptance/helpers/command_helpers.rb +0 -55
  166. data/spec/support/acceptance/helpers/file_helpers.rb +0 -19
  167. data/spec/support/acceptance/helpers/gem_helpers.rb +0 -31
  168. data/spec/support/acceptance/helpers/minitest_helpers.rb +0 -11
  169. data/spec/support/acceptance/helpers/n_unit_helpers.rb +0 -25
  170. data/spec/support/acceptance/helpers/pluralization_helpers.rb +0 -13
  171. data/spec/support/acceptance/helpers/rails_version_helpers.rb +0 -11
  172. data/spec/support/acceptance/helpers/rspec_helpers.rb +0 -24
  173. data/spec/support/acceptance/helpers/ruby_version_helpers.rb +0 -9
  174. data/spec/support/acceptance/helpers/step_helpers.rb +0 -127
  175. data/spec/support/acceptance/helpers.rb +0 -31
  176. data/spec/support/acceptance/matchers/have_output.rb +0 -31
  177. data/spec/support/acceptance/matchers/indicate_number_of_tests_was_run_matcher.rb +0 -55
  178. data/spec/support/acceptance/matchers/indicate_that_tests_were_run_matcher.rb +0 -103
  179. data/spec/support/tests/bundle.rb +0 -94
  180. data/spec/support/tests/command_runner.rb +0 -230
  181. data/spec/support/tests/current_bundle.rb +0 -61
  182. data/spec/support/tests/database.rb +0 -28
  183. data/spec/support/tests/database_adapters/postgresql.rb +0 -25
  184. data/spec/support/tests/database_adapters/sqlite3.rb +0 -26
  185. data/spec/support/tests/database_configuration.rb +0 -33
  186. data/spec/support/tests/database_configuration_registry.rb +0 -28
  187. data/spec/support/tests/filesystem.rb +0 -100
  188. data/spec/support/tests/version.rb +0 -45
  189. data/spec/support/unit/active_record/create_table.rb +0 -54
  190. data/spec/support/unit/attribute.rb +0 -47
  191. data/spec/support/unit/capture.rb +0 -40
  192. data/spec/support/unit/change_value.rb +0 -111
  193. data/spec/support/unit/create_model_arguments/basic.rb +0 -135
  194. data/spec/support/unit/create_model_arguments/has_many.rb +0 -15
  195. data/spec/support/unit/create_model_arguments/uniqueness_matcher.rb +0 -74
  196. data/spec/support/unit/helpers/active_model_helpers.rb +0 -27
  197. data/spec/support/unit/helpers/active_model_versions.rb +0 -28
  198. data/spec/support/unit/helpers/active_record_versions.rb +0 -24
  199. data/spec/support/unit/helpers/active_resource_builder.rb +0 -27
  200. data/spec/support/unit/helpers/allow_value_matcher_helpers.rb +0 -15
  201. data/spec/support/unit/helpers/class_builder.rb +0 -90
  202. data/spec/support/unit/helpers/column_type_helpers.rb +0 -26
  203. data/spec/support/unit/helpers/confirmation_matcher_helpers.rb +0 -17
  204. data/spec/support/unit/helpers/controller_builder.rb +0 -63
  205. data/spec/support/unit/helpers/database_helpers.rb +0 -20
  206. data/spec/support/unit/helpers/i18n_faker.rb +0 -15
  207. data/spec/support/unit/helpers/mailer_builder.rb +0 -12
  208. data/spec/support/unit/helpers/model_builder.rb +0 -114
  209. data/spec/support/unit/helpers/rails_versions.rb +0 -28
  210. data/spec/support/unit/helpers/validation_matcher_scenario_helpers.rb +0 -44
  211. data/spec/support/unit/i18n.rb +0 -7
  212. data/spec/support/unit/load_environment.rb +0 -12
  213. data/spec/support/unit/matchers/deprecate.rb +0 -60
  214. data/spec/support/unit/matchers/fail_with_message_including_matcher.rb +0 -51
  215. data/spec/support/unit/matchers/fail_with_message_matcher.rb +0 -62
  216. data/spec/support/unit/matchers/print_warning_including.rb +0 -59
  217. data/spec/support/unit/model_creation_strategies/active_model.rb +0 -111
  218. data/spec/support/unit/model_creation_strategies/active_record.rb +0 -77
  219. data/spec/support/unit/model_creators/active_model.rb +0 -39
  220. data/spec/support/unit/model_creators/active_record/has_and_belongs_to_many.rb +0 -95
  221. data/spec/support/unit/model_creators/active_record/has_many.rb +0 -67
  222. data/spec/support/unit/model_creators/active_record/uniqueness_matcher.rb +0 -42
  223. data/spec/support/unit/model_creators/active_record.rb +0 -43
  224. data/spec/support/unit/model_creators/basic.rb +0 -97
  225. data/spec/support/unit/model_creators.rb +0 -19
  226. data/spec/support/unit/rails_application.rb +0 -126
  227. data/spec/support/unit/record_builder_with_i18n_validation_message.rb +0 -69
  228. data/spec/support/unit/record_validating_confirmation_builder.rb +0 -51
  229. data/spec/support/unit/record_with_different_error_attribute_builder.rb +0 -92
  230. data/spec/support/unit/shared_examples/ignoring_interference_by_writer.rb +0 -79
  231. data/spec/support/unit/shared_examples/numerical_submatcher.rb +0 -17
  232. data/spec/support/unit/shared_examples/set_session_or_flash.rb +0 -360
  233. data/spec/support/unit/validation_matcher_scenario.rb +0 -62
  234. data/spec/unit/shoulda/matchers/action_controller/callback_matcher_spec.rb +0 -82
  235. data/spec/unit/shoulda/matchers/action_controller/filter_param_matcher_spec.rb +0 -28
  236. data/spec/unit/shoulda/matchers/action_controller/permit_matcher_spec.rb +0 -592
  237. data/spec/unit/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb +0 -42
  238. data/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb +0 -76
  239. data/spec/unit/shoulda/matchers/action_controller/render_with_layout_matcher_spec.rb +0 -62
  240. data/spec/unit/shoulda/matchers/action_controller/rescue_from_matcher_spec.rb +0 -90
  241. data/spec/unit/shoulda/matchers/action_controller/respond_with_matcher_spec.rb +0 -31
  242. data/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb +0 -330
  243. data/spec/unit/shoulda/matchers/action_controller/route_params_spec.rb +0 -30
  244. data/spec/unit/shoulda/matchers/action_controller/set_flash_matcher_spec.rb +0 -67
  245. data/spec/unit/shoulda/matchers/action_controller/set_session_matcher_spec.rb +0 -17
  246. data/spec/unit/shoulda/matchers/action_controller/set_session_or_flash_matcher_spec.rb +0 -562
  247. data/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +0 -115
  248. data/spec/unit/shoulda/matchers/active_model/allow_value_matcher_spec.rb +0 -823
  249. data/spec/unit/shoulda/matchers/active_model/disallow_value_matcher_spec.rb +0 -86
  250. data/spec/unit/shoulda/matchers/active_model/have_secure_password_matcher_spec.rb +0 -20
  251. data/spec/unit/shoulda/matchers/active_model/helpers_spec.rb +0 -162
  252. data/spec/unit/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb +0 -266
  253. data/spec/unit/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb +0 -91
  254. data/spec/unit/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +0 -149
  255. data/spec/unit/shoulda/matchers/active_model/validate_exclusion_of_matcher_spec.rb +0 -207
  256. data/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +0 -1015
  257. data/spec/unit/shoulda/matchers/active_model/validate_length_of_matcher_spec.rb +0 -288
  258. data/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +0 -1837
  259. data/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +0 -380
  260. data/spec/unit/shoulda/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +0 -107
  261. data/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb +0 -1242
  262. data/spec/unit/shoulda/matchers/active_record/association_matchers/model_reflection_spec.rb +0 -251
  263. data/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb +0 -168
  264. data/spec/unit/shoulda/matchers/active_record/have_db_column_matcher_spec.rb +0 -111
  265. data/spec/unit/shoulda/matchers/active_record/have_db_index_matcher_spec.rb +0 -85
  266. data/spec/unit/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb +0 -41
  267. data/spec/unit/shoulda/matchers/active_record/serialize_matcher_spec.rb +0 -86
  268. data/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb +0 -1418
  269. data/spec/unit/shoulda/matchers/doublespeak/double_collection_spec.rb +0 -190
  270. data/spec/unit/shoulda/matchers/doublespeak/double_implementation_registry_spec.rb +0 -21
  271. data/spec/unit/shoulda/matchers/doublespeak/double_spec.rb +0 -271
  272. data/spec/unit/shoulda/matchers/doublespeak/object_double_spec.rb +0 -77
  273. data/spec/unit/shoulda/matchers/doublespeak/proxy_implementation_spec.rb +0 -72
  274. data/spec/unit/shoulda/matchers/doublespeak/stub_implementation_spec.rb +0 -101
  275. data/spec/unit/shoulda/matchers/doublespeak/world_spec.rb +0 -80
  276. data/spec/unit/shoulda/matchers/doublespeak_spec.rb +0 -27
  277. data/spec/unit/shoulda/matchers/independent/delegate_method_matcher/stubbed_target_spec.rb +0 -43
  278. data/spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb +0 -517
  279. data/spec/unit/shoulda/matchers/routing/route_matcher_spec.rb +0 -242
  280. data/spec/unit/shoulda/matchers/util/word_wrap_spec.rb +0 -252
  281. data/spec/unit_spec_helper.rb +0 -46
  282. data/spec/warnings_spy/filesystem.rb +0 -45
  283. data/spec/warnings_spy/partitioner.rb +0 -36
  284. data/spec/warnings_spy/reader.rb +0 -53
  285. data/spec/warnings_spy/reporter.rb +0 -88
  286. data/spec/warnings_spy.rb +0 -64
  287. data/tasks/documentation.rb +0 -199
  288. data/zeus.json +0 -11
data/README.md CHANGED
@@ -1,17 +1,358 @@
1
- # Shoulda Matchers [![Gem Version][version-badge]][rubygems] [![Build Status][travis-badge]][travis] ![Downloads][downloads-badge]
1
+ # Shoulda Matchers [![Gem Version][version-badge]][rubygems] [![Build Status][github-actions-badge]][github-actions] [![Total Downloads][downloads-total]][rubygems] [![Downloads][downloads-badge]][rubygems]
2
2
 
3
- Shoulda Matchers provides RSpec- and Minitest-compatible one-liners that test
4
- common Rails functionality. These tests would otherwise be much longer, more
3
+ [version-badge]: https://img.shields.io/gem/v/shoulda-matchers.svg
4
+ [rubygems]: https://rubygems.org/gems/shoulda-matchers
5
+ [github-actions-badge]: https://img.shields.io/github/workflow/status/thoughtbot/shoulda-matchers/Test
6
+ [github-actions]: https://github.com/thoughtbot/shoulda-matchers/actions
7
+ [downloads-total]: https://img.shields.io/gem/dt/shoulda-matchers.svg
8
+ [downloads-badge]: https://img.shields.io/gem/dtv/shoulda-matchers.svg
9
+ [downloads-badge]: https://img.shields.io/gem/dtv/shoulda-matchers.svg
10
+
11
+ [![shoulda-matchers][logo]][website]
12
+
13
+ [logo]: https://matchers.shoulda.io/images/shoulda-matchers-logo.png
14
+ [website]: https://matchers.shoulda.io/
15
+
16
+ Shoulda Matchers provides RSpec- and Minitest-compatible one-liners to test
17
+ common Rails functionality that, if written by hand, would be much longer, more
5
18
  complex, and error-prone.
6
19
 
7
- [View the official documentation for the latest version (3.0.0).][rubydocs]
20
+ ## Quick links
21
+
22
+ 📖 **[Read the documentation for the latest version][rubydocs].**
23
+ 📢 **[See what's changed in recent versions][changelog].**
24
+
25
+ [rubydocs]: https://matchers.shoulda.io/docs
26
+ [changelog]: CHANGELOG.md
27
+
28
+ ## Table of contents
29
+
30
+ * [Getting started](#getting-started)
31
+ * [RSpec](#rspec)
32
+ * [Minitest](#minitest)
33
+ * [Usage](#usage)
34
+ * [On the subject of `subject`](#on-the-subject-of-subject)
35
+ * [Availability of RSpec matchers in example groups](#availability-of-rspec-matchers-in-example-groups)
36
+ * [`should` vs `is_expected.to`](#should-vs-is_expectedto)
37
+ * [Matchers](#matchers)
38
+ * [ActiveModel matchers](#activemodel-matchers)
39
+ * [ActiveRecord matchers](#activerecord-matchers)
40
+ * [ActionController matchers](#actioncontroller-matchers)
41
+ * [Independent matchers](#independent-matchers)
42
+ * [Extensions](#extensions)
43
+ * [Contributing](#contributing)
44
+ * [Compatibility](#compatibility)
45
+ * [Versioning](#versioning)
46
+ * [Team](#team)
47
+ * [Copyright/License](#copyright-license)
48
+ * [About thoughtbot](#about-thoughtbot)
49
+
50
+ ## Getting started
51
+
52
+ ### RSpec
53
+
54
+ Start by including `shoulda-matchers` in your Gemfile:
55
+
56
+ ```ruby
57
+ group :test do
58
+ gem 'shoulda-matchers', '~> 5.0'
59
+ end
60
+ ```
61
+
62
+ Then run `bundle install`.
63
+
64
+ Now you need to configure the gem by telling it:
65
+
66
+ * which matchers you want to use in your tests
67
+ * that you're using RSpec so that it can make those matchers available in
68
+ your example groups
69
+
70
+ #### Rails apps
71
+
72
+ If you're working on a Rails app, simply place this at the bottom of
73
+ `spec/rails_helper.rb` (or in a support file if you so choose):
74
+
75
+ ```ruby
76
+ Shoulda::Matchers.configure do |config|
77
+ config.integrate do |with|
78
+ with.test_framework :rspec
79
+ with.library :rails
80
+ end
81
+ end
82
+ ```
83
+
84
+ #### Non-Rails apps
85
+
86
+ If you're not working on a Rails app, but you still make use of ActiveRecord or
87
+ ActiveModel in your project, you can still use this gem too! In that case,
88
+ you'll want to place the following configuration at the bottom of
89
+ `spec/spec_helper.rb`:
90
+
91
+ ```ruby
92
+ Shoulda::Matchers.configure do |config|
93
+ config.integrate do |with|
94
+ with.test_framework :rspec
95
+
96
+ # Keep as many of these lines as are necessary:
97
+ with.library :active_record
98
+ with.library :active_model
99
+ end
100
+ end
101
+ ```
102
+
103
+ ### Minitest
104
+
105
+ If you're using our umbrella gem [Shoulda], then make sure that you're using the
106
+ latest version:
107
+
108
+ ```ruby
109
+ group :test do
110
+ gem 'shoulda', '~> 4.0'
111
+ end
112
+ ```
113
+
114
+ [Shoulda]: https://github.com/thoughtbot/shoulda
115
+
116
+ Otherwise, add `shoulda-matchers` to your Gemfile:
117
+
118
+ ```ruby
119
+ group :test do
120
+ gem 'shoulda-matchers', '~> 5.0'
121
+ end
122
+ ```
123
+
124
+ Then run `bundle install`.
125
+
126
+ Now you need to configure the gem by telling it:
127
+
128
+ * which matchers you want to use in your tests
129
+ * that you're using Minitest so that it can make those matchers available in
130
+ your test case classes
131
+
132
+ #### Rails apps
133
+
134
+ If you're working on a Rails app, simply place this at the bottom of
135
+ `test/test_helper.rb`:
136
+
137
+ ```ruby
138
+ Shoulda::Matchers.configure do |config|
139
+ config.integrate do |with|
140
+ with.test_framework :minitest
141
+ with.library :rails
142
+ end
143
+ end
144
+ ```
145
+
146
+ #### Non-Rails apps
147
+
148
+ If you're not working on a Rails app, but you still make use of ActiveRecord or
149
+ ActiveModel in your project, you can still use this gem too! In that case,
150
+ you'll want to place the following configuration at the bottom of
151
+ `test/test_helper.rb`:
152
+
153
+ ```ruby
154
+ Shoulda::Matchers.configure do |config|
155
+ config.integrate do |with|
156
+ with.test_framework :minitest
157
+
158
+ # Keep as many of these lines as are necessary:
159
+ with.library :active_record
160
+ with.library :active_model
161
+ end
162
+ end
163
+ ```
164
+
165
+ ## Usage
166
+
167
+ Most of the matchers provided by this gem are useful in a Rails context, and as
168
+ such, can be used for different parts of a Rails app:
169
+
170
+ * [database models backed by ActiveRecord](#activemodel-matchers)
171
+ * [non-database models, form objects, etc. backed by
172
+ ActiveModel](#activerecord-matchers)
173
+ * [controllers](#actioncontroller-matchers)
174
+ * [routes](#routing-matchers) (RSpec only)
175
+ * [Rails-specific features like `delegate`](#independent-matchers)
176
+
177
+ As the name of the gem indicates, most matchers are designed to be used in
178
+ "one-liner" form using the `should` macro, a special directive available in both
179
+ RSpec and [Shoulda]. For instance, a model test case may look something like:
180
+
181
+ ``` ruby
182
+ # RSpec
183
+ RSpec.describe MenuItem, type: :model do
184
+ describe 'associations' do
185
+ it { should belong_to(:category).class_name('MenuCategory') }
186
+ end
187
+
188
+ describe 'validations' do
189
+ it { should validate_presence_of(:name) }
190
+ it { should validate_uniqueness_of(:name).scoped_to(:category_id) }
191
+ end
192
+ end
193
+
194
+ # Minitest (Shoulda)
195
+ class MenuItemTest < ActiveSupport::TestCase
196
+ context 'associations' do
197
+ should belong_to(:category).class_name('MenuCategory')
198
+ end
199
+
200
+ context 'validations' do
201
+ should validate_presence_of(:name)
202
+ should validate_uniqueness_of(:name).scoped_to(:category_id)
203
+ end
204
+ end
205
+ ```
206
+
207
+ [See below](#matchers) for the full set of matchers that you can use.
208
+
209
+ ### On the subject of `subject`
210
+
211
+ For both RSpec and Shoulda, the **subject** is an implicit reference to the
212
+ object under test, and through the use of `should` as demonstrated above, all of
213
+ the matchers make use of `subject` internally when they are run. A `subject` is
214
+ always set automatically by your test framework in any given test case; however,
215
+ in certain cases it can be advantageous to override it. For instance, when
216
+ testing validations in a model, it is customary to provide a valid model instead
217
+ of a fresh one:
218
+
219
+ ``` ruby
220
+ # RSpec
221
+ RSpec.describe Post, type: :model do
222
+ describe 'validations' do
223
+ # Here we're using FactoryBot, but you could use anything
224
+ subject { build(:post) }
225
+
226
+ it { should validate_presence_of(:title) }
227
+ end
228
+ end
229
+
230
+ # Minitest (Shoulda)
231
+ class PostTest < ActiveSupport::TestCase
232
+ context 'validations' do
233
+ subject { build(:post) }
234
+
235
+ should validate_presence_of(:title)
236
+ end
237
+ end
238
+ ```
239
+
240
+ When overriding the subject in this manner, then, it's important to provide the
241
+ correct object. **When in doubt, provide an instance of the class under test.**
242
+ This is particularly necessary for controller tests, where it is easy to
243
+ accidentally write something like:
244
+
245
+ ``` ruby
246
+ RSpec.describe PostsController, type: :controller do
247
+ describe 'GET #index' do
248
+ subject { get :index }
249
+
250
+ # This may work...
251
+ it { should have_http_status(:success) }
252
+ # ...but this will not!
253
+ it { should permit(:title, :body).for(:post) }
254
+ end
255
+ end
256
+ ```
257
+
258
+ In this case, you would want to use `before` rather than `subject`:
259
+
260
+ ``` ruby
261
+ RSpec.describe PostsController, type: :controller do
262
+ describe 'GET #index' do
263
+ before { get :index }
264
+
265
+ # Notice that we have to assert have_http_status on the response here...
266
+ it { expect(response).to have_http_status(:success) }
267
+ # ...but we do not have to provide a subject for render_template
268
+ it { should render_template('index') }
269
+ end
270
+ end
271
+ ```
272
+
273
+ ### Availability of RSpec matchers in example groups
274
+
275
+ #### Rails projects
276
+
277
+ If you're using RSpec, then you're probably familiar with the concept of example
278
+ groups. Example groups can be assigned tags order to assign different behavior
279
+ to different kinds of example groups. This comes into play especially when using
280
+ `rspec-rails`, where, for instance, controller example groups, tagged with
281
+ `type: :controller`, are written differently than request example groups, tagged
282
+ with `type: :request`. This difference in writing style arises because
283
+ `rspec-rails` mixes different behavior and methods into controller example
284
+ groups vs. request example groups.
285
+
286
+ Relying on this behavior, Shoulda Matchers automatically makes certain matchers
287
+ available in certain kinds of example groups:
288
+
289
+ * ActiveRecord and ActiveModel matchers are available only in model example
290
+ groups, i.e., those tagged with `type: :model` or in files located under
291
+ `spec/models`.
292
+ * ActionController matchers are available only in controller example groups,
293
+ i.e., those tagged with `type: :controller` or in files located under
294
+ `spec/controllers`.
295
+ * The `route` matcher is available in routing example groups, i.e., those
296
+ tagged with `type: :routing` or in files located under `spec/routing`.
297
+ * Independent matchers are available in all example groups.
298
+
299
+ As long as you're using Rails, you don't need to worry about these details —
300
+ everything should "just work".
301
+
302
+ #### Non-Rails projects
303
+
304
+ **What if you are using ActiveModel or ActiveRecord outside of Rails, however,
305
+ and you want to use model matchers in a certain example group?** Then you'll
306
+ need to manually include the module that holds those matchers into that example
307
+ group. For instance, you might have to say:
308
+
309
+ ``` ruby
310
+ RSpec.describe MySpecialModel do
311
+ include Shoulda::Matchers::ActiveModel
312
+ include Shoulda::Matchers::ActiveRecord
313
+ end
314
+ ```
315
+
316
+ If you have a lot of similar example groups in which you need to do this, then
317
+ you might find it more helpful to tag your example groups appropriately, then
318
+ instruct RSpec to mix these modules into any example groups that have that tag.
319
+ For instance, you could add this to your `rails_helper.rb`:
320
+
321
+ ```ruby
322
+ RSpec.configure do |config|
323
+ config.include(Shoulda::Matchers::ActiveModel, type: :model)
324
+ config.include(Shoulda::Matchers::ActiveRecord, type: :model)
325
+ end
326
+ ```
327
+
328
+ And from then on, you could say:
329
+
330
+ ```ruby
331
+ RSpec.describe MySpecialModel, type: :model do
332
+ # ...
333
+ end
334
+ ```
335
+
336
+ ### `should` vs `is_expected.to`
8
337
 
9
- ----
338
+ In this README and throughout the documentation, you'll notice that we use the
339
+ `should` form of RSpec's one-liner syntax over `is_expected.to`. Beside being
340
+ the namesake of the gem itself, this is our preferred syntax as it's short and
341
+ sweet. But if you prefer to use `is_expected.to`, you can do that too:
342
+
343
+ ```ruby
344
+ RSpec.describe Person, type: :model do
345
+ it { is_expected.to validate_presence_of(:name) }
346
+ end
347
+ ```
348
+
349
+ ## Matchers
350
+
351
+ Here is the full list of matchers that ship with this gem. If you need details
352
+ about any of them, make sure to [consult the documentation][rubydocs]!
10
353
 
11
354
  ### ActiveModel matchers
12
355
 
13
- * **[allow_mass_assignment_of](lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb)**
14
- tests usage of Rails 3's `attr_accessible` and `attr_protected` macros.
15
356
  * **[allow_value](lib/shoulda/matchers/active_model/allow_value_matcher.rb)**
16
357
  tests that an attribute is valid or invalid if set to one or more values.
17
358
  *(Aliased as #allow_values.)*
@@ -42,18 +383,26 @@ complex, and error-prone.
42
383
  tests your `belongs_to` associations.
43
384
  * **[define_enum_for](lib/shoulda/matchers/active_record/define_enum_for_matcher.rb)**
44
385
  tests usage of the `enum` macro.
45
- * **[have_and_belong_to_many](lib/shoulda/matchers/active_record/association_matcher.rb)**
386
+ * **[have_and_belong_to_many](lib/shoulda/matchers/active_record/association_matcher.rb#L827)**
46
387
  tests your `has_and_belongs_to_many` associations.
47
388
  * **[have_db_column](lib/shoulda/matchers/active_record/have_db_column_matcher.rb)**
48
389
  tests that the table that backs your model has a specific column.
49
390
  * **[have_db_index](lib/shoulda/matchers/active_record/have_db_index_matcher.rb)**
50
391
  tests that the table that backs your model has an index on a specific column.
51
- * **[have_many](lib/shoulda/matchers/active_record/association_matcher.rb)**
392
+ * **[have_implicit_order_column](lib/shoulda/matchers/active_record/have_implicit_order_column.rb)**
393
+ tests usage of `implicit_order_column`.
394
+ * **[have_many](lib/shoulda/matchers/active_record/association_matcher.rb#L328)**
52
395
  tests your `has_many` associations.
53
- * **[have_one](lib/shoulda/matchers/active_record/association_matcher.rb)**
396
+ * **[have_many_attached](lib/shoulda/matchers/active_record/have_attached_matcher.rb)**
397
+ tests your `has_many_attached` associations.
398
+ * **[have_one](lib/shoulda/matchers/active_record/association_matcher.rb#L598)**
54
399
  tests your `has_one` associations.
400
+ * **[have_one_attached](lib/shoulda/matchers/active_record/have_attached_matcher.rb)**
401
+ tests your `has_one_attached` associations.
55
402
  * **[have_readonly_attribute](lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb)**
56
403
  tests usage of the `attr_readonly` macro.
404
+ * **[have_rich_text](lib/shoulda/matchers/active_record/have_rich_text_matcher.rb)**
405
+ tests your `has_rich_text` associations.
57
406
  * **[serialize](lib/shoulda/matchers/active_record/serialize_matcher.rb)** tests
58
407
  usage of the `serialize` macro.
59
408
  * **[validate_uniqueness_of](lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb)**
@@ -81,15 +430,17 @@ complex, and error-prone.
81
430
  makes assertions on the `session` hash.
82
431
  * **[set_flash](lib/shoulda/matchers/action_controller/set_flash_matcher.rb)**
83
432
  makes assertions on the `flash` hash.
84
- * **[use_after_action](lib/shoulda/matchers/action_controller/callback_matcher.rb#L79)**
85
- tests that an `after_action` callback is defined in your controller. *(Aliased
86
- as #use_after_filter.)*
87
- * **[use_around_action](lib/shoulda/matchers/action_controller/callback_matcher.rb#L129)**
88
- tests that an `around_action` callback is defined in your controller. *(Aliased
89
- as #use_around_filter.)*
90
- * **[use_before_action](lib/shoulda/matchers/action_controller/callback_matcher.rb#L54)**
91
- tests that a `before_action` callback is defined in your controller. *(Aliased
92
- as #use_before_filter.)*
433
+ * **[use_after_action](lib/shoulda/matchers/action_controller/callback_matcher.rb#L29)**
434
+ tests that an `after_action` callback is defined in your controller.
435
+ * **[use_around_action](lib/shoulda/matchers/action_controller/callback_matcher.rb#L75)**
436
+ tests that an `around_action` callback is defined in your controller.
437
+ * **[use_before_action](lib/shoulda/matchers/action_controller/callback_matcher.rb#L4)**
438
+ tests that a `before_action` callback is defined in your controller.
439
+
440
+ ### Routing matchers
441
+
442
+ * **[route](lib/shoulda/matchers/action_controller/route_matcher.rb)** tests
443
+ your routes.
93
444
 
94
445
  ### Independent matchers
95
446
 
@@ -97,242 +448,66 @@ complex, and error-prone.
97
448
  tests that an object forwards messages to other, internal objects by way of
98
449
  delegation.
99
450
 
100
- ## Getting started
101
-
102
- ### RSpec
103
-
104
- Include `shoulda-matchers` in your Gemfile:
105
-
106
- ``` ruby
107
- group :test do
108
- gem 'shoulda-matchers', '~> 3.0'
109
- end
110
- ```
111
-
112
- [Then, configure the gem to integrate with RSpec](#configuration).
113
-
114
- Now you can use matchers in your tests. For instance a model test might look
115
- like this:
116
-
117
- ``` ruby
118
- describe Person do
119
- it { should validate_presence_of(:name) }
120
- end
121
- ```
122
-
123
- #### Availability of matchers in various example groups
124
-
125
- Since shoulda-matchers provides four categories of matchers, there are four
126
- different levels where you can use these matchers:
127
-
128
- * ActiveRecord and ActiveModel matchers are available only in model example
129
- groups, i.e., those tagged with `type: :model` or in files located under
130
- `spec/models`.
131
- * ActionController matchers are available only in controller example groups,
132
- i.e., those tagged with `type: :controller` or in files located under
133
- `spec/controllers`.
134
- * The `route` matcher is available also in routing example groups, i.e., those
135
- tagged with `type: :routing` or in files located under `spec/routing`.
136
- * Independent matchers are available in all example groups.
137
-
138
- **If you are using ActiveModel or ActiveRecord outside of Rails** and you want
139
- to use model matchers in certain example groups, you'll need to manually include
140
- them. Here's a good way of doing that:
141
-
142
- ``` ruby
143
- RSpec.configure do |config|
144
- config.include(Shoulda::Matchers::ActiveModel, type: :model)
145
- config.include(Shoulda::Matchers::ActiveRecord, type: :model)
146
- end
147
- ```
148
-
149
- Then you can say:
150
-
151
- ``` ruby
152
- describe MyModel, type: :model do
153
- # ...
154
- end
155
- ```
156
-
157
- #### `should` vs `is_expected.to`
451
+ ## Extensions
158
452
 
159
- Note that in this README and throughout the documentation we're using the
160
- `should` form of RSpec's one-liner syntax over `is_expected.to`. The `should`
161
- form works regardless of how you've configured RSpec -- meaning you can still
162
- use it even when using the `expect` syntax. But if you prefer to use
163
- `is_expected.to`, you can do that too:
453
+ Over time our community has created extensions to Shoulda Matchers. If you've
454
+ created something that you want to share, please [let us know][new-issue]!
164
455
 
165
- ``` ruby
166
- describe Person do
167
- it { is_expected.to validate_presence_of(:name) }
168
- end
169
- ```
170
-
171
- ### Minitest
172
-
173
- Shoulda Matchers was originally a component of [Shoulda][shoulda], a gem that
174
- also provides `should` and `context` syntax via
175
- [`shoulda-context`][shoulda-context].
176
-
177
- At the moment, `shoulda` has not been updated to support `shoulda-matchers` 3.0,
178
- so you'll want to add the following to your Gemfile:
179
-
180
- ```ruby
181
- group :test do
182
- gem 'shoulda', '~> 3.5'
183
- gem 'shoulda-matchers', '~> 2.0'
184
- end
185
- ```
186
-
187
- [Then, configure the gem to integrate with Minitest](#configuration).
188
-
189
- Now you can use matchers in your tests. For instance a model test might look
190
- like this:
191
-
192
- ``` ruby
193
- class PersonTest < ActiveSupport::TestCase
194
- should validate_presence_of(:name)
195
- end
196
- ```
197
-
198
- ### Configuration
199
-
200
- Before you can use Shoulda Matchers, you'll need to tell it a couple of things:
201
-
202
- * Which test framework you're using
203
- * Which portion of the matchers you want to use
204
-
205
- You can supply this information by using a configuration block. Place the
206
- following in `rails_helper.rb` (if you're using RSpec) or `test_helper.rb` (if
207
- you're using Minitest):
208
-
209
- ``` ruby
210
- Shoulda::Matchers.configure do |config|
211
- config.integrate do |with|
212
- # Choose a test framework:
213
- with.test_framework :rspec
214
- with.test_framework :minitest
215
- with.test_framework :minitest_4
216
- with.test_framework :test_unit
217
-
218
- # Choose one or more libraries:
219
- with.library :active_record
220
- with.library :active_model
221
- with.library :action_controller
222
- # Or, choose the following (which implies all of the above):
223
- with.library :rails
224
- end
225
- end
226
- ```
227
-
228
- ## Running tests
229
-
230
- ### Unit tests
231
-
232
- Unit tests are the most common kind of tests in this gem, and the best way to
233
- run them is by using [Zeus].
234
-
235
- You'll want to run `zeus start` in one shell, then in another shell, instead of
236
- using `rspec` to run tests, you can use `zeus rspec`. So for instance, you might
237
- say:
238
-
239
- ```
240
- zeus rspec spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb
241
- ```
242
-
243
- As a shortcut, you can also drop the initial part of the path and say this
244
- instead:
456
+ * **[shoulda-matchers-cucumber]** – Adds support for using Shoulda Matchers in
457
+ Cucumber tests.
245
458
 
246
- ```
247
- zeus rspec active_model/validate_inclusion_of_matcher_spec.rb
248
- ```
249
-
250
- ### Acceptance tests
459
+ [new-issue]: https://github.com/thoughtbot/shoulda-matchers/issues/new
460
+ [shoulda-matchers-cucumber]: https://github.com/majioa/shoulda-matchers-cucumber
251
461
 
252
- The gem uses [Appraisal] to test against multiple versions of Rails and Ruby.
253
- This means that if you're trying to run a single test file, you'll need to
254
- specify which appraisal to use. For instance, you can't simply say:
255
-
256
- ```
257
- rspec spec/acceptance/active_model_integration_spec.rb
258
- ```
259
-
260
- Instead, you need to say
261
-
262
- ```
263
- bundle exec appraisal 4.2 rspec spec/acceptance/active_model_integration_spec.rb
264
- ```
265
-
266
- ### All tests
267
-
268
- You can run all tests by saying:
269
-
270
- ```
271
- bundle exec rake
272
- ```
273
-
274
- ## Generating documentation
275
-
276
- YARD is used to generate documentation, which can be viewed [online][rubydocs].
277
- You can preview changes you make to the documentation locally by running
462
+ ## Contributing
278
463
 
279
- yard doc
464
+ Have a fix for a problem you've been running into or an idea for a new feature
465
+ you think would be useful? Take a look at the [Contributing
466
+ document](CONTRIBUTING.md) for instructions on setting up the repo on your
467
+ machine, understanding the codebase, and creating a good pull request.
280
468
 
281
- from this directory. Then, open `doc/index.html` in your browser.
469
+ ## Compatibility
282
470
 
283
- If you want to be able to regenerate the docs as you work without having to run
284
- `yard doc` over and over again, keep this command running in a separate terminal
285
- session:
471
+ Shoulda Matchers is tested and supported against Ruby 2.6+, Rails
472
+ 5.2+, RSpec 3.x, and Minitest 5.x.
286
473
 
287
- rake docs:autogenerate
474
+ - For Ruby < 2.4 and Rails < 4.1 compatibility, please use [v3.1.3][v3.1.3].
475
+ - For Ruby < 3.0 and Rails < 6.1 compatibility, please use [v4.5.1][v4.5.1].
288
476
 
289
- ## Contributing
477
+ [v3.1.3]: https://github.com/thoughtbot/shoulda-matchers/tree/v3.1.3
478
+ [v4.5.1]: https://github.com/thoughtbot/shoulda-matchers/tree/v4.5.1
290
479
 
291
- Shoulda Matchers is open source, and we are grateful for
292
- [everyone][contributors] who's contributed so far.
480
+ ## Versioning
293
481
 
294
- If you'd like to contribute, please take a look at the
295
- [instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
296
- pull request.
482
+ Shoulda Matchers follows Semantic Versioning 2.0 as defined at
483
+ <https://semver.org>.
297
484
 
298
- ## Compatibility
485
+ ## Team
299
486
 
300
- Shoulda Matchers is tested and supported against Rails 4.x, RSpec 3.x, Minitest
301
- 5, Minitest 4, and Ruby 2.x.
487
+ Shoulda Matchers is maintained by [Elliot Winkler][mcmire] and [Gui
488
+ Albuk][guialbuk].
302
489
 
303
- ## Versioning
490
+ [mcmire]: https://github.com/mcmire
491
+ [guialbuk]: https://github.com/guialbuk
304
492
 
305
- Shoulda Matchers follows Semantic Versioning 2.0 as defined at
306
- <http://semver.org>.
493
+ ## Copyright/License
307
494
 
308
- ## License
495
+ Shoulda Matchers is copyright © 2006-2022 Tammer Saleh and [thoughtbot,
496
+ inc][thoughtbot-website]. It is free and opensource software and may be
497
+ redistributed under the terms specified in the [LICENSE](LICENSE) file.
309
498
 
310
- Shoulda Matchers is copyright © 2006-2016
311
- [thoughtbot, inc](https://thoughtbot.com/). It is free software,
312
- and may be redistributed under the terms specified in the
313
- [MIT-LICENSE](MIT-LICENSE) file.
499
+ [thoughtbot-website]: https://thoughtbot.com
314
500
 
315
501
  ## About thoughtbot
316
502
 
317
- ![thoughtbot](https://thoughtbot.com/logo.png)
503
+ ![thoughtbot][thoughtbot-logo]
504
+
505
+ [thoughtbot-logo]: https://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg
318
506
 
319
- Shoulda Matchers is maintained and funded by thoughtbot, inc.
320
507
  The names and logos for thoughtbot are trademarks of thoughtbot, inc.
321
508
 
322
- We are passionate about open source software.
323
- See [our other projects][community].
324
- We are [available for hire][hire].
509
+ We are passionate about open source software. See [our other
510
+ projects][community]. We are [available for hire][hire].
325
511
 
326
512
  [community]: https://thoughtbot.com/community?utm_source=github
327
513
  [hire]: https://thoughtbot.com?utm_source=github
328
- [version-badge]: http://img.shields.io/gem/v/shoulda-matchers.svg
329
- [rubygems]: http://rubygems.org/gems/shoulda-matchers
330
- [travis-badge]: http://img.shields.io/travis/thoughtbot/shoulda-matchers/master.svg
331
- [travis]: http://travis-ci.org/thoughtbot/shoulda-matchers
332
- [downloads-badge]: http://img.shields.io/gem/dtv/shoulda-matchers.svg
333
- [rubydocs]: http://matchers.shoulda.io/docs
334
- [contributors]: https://github.com/thoughtbot/shoulda-matchers/contributors
335
- [shoulda]: http://github.com/thoughtbot/shoulda
336
- [shoulda-context]: http://github.com/thoughtbot/shoulda-context
337
- [Zeus]: https://github.com/burke/zeus
338
- [Appraisal]: https://github.com/thoughtbot/appraisal