shoulda-matchers 3.1.3 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.hound/ruby.yml +336 -316
  3. data/.python-version +1 -0
  4. data/.rubocop.yml +3 -1
  5. data/.travis.yml +7 -6
  6. data/Appraisals +76 -44
  7. data/CONTRIBUTING.md +137 -66
  8. data/Gemfile +5 -5
  9. data/Gemfile.lock +30 -35
  10. data/MAINTAINING.md +250 -0
  11. data/MIT-LICENSE +1 -1
  12. data/NEWS.md +176 -4
  13. data/README.md +138 -200
  14. data/Rakefile +7 -0
  15. data/bin/setup +190 -0
  16. data/doc_config/yard/templates/default/fulldoc/html/css/global.css +4 -0
  17. data/doc_config/yard/templates/default/fulldoc/html/full_list.erb +0 -6
  18. data/doc_config/yard/templates/default/fulldoc/html/js/app.js +0 -17
  19. data/doc_config/yard/templates/default/fulldoc/html/setup.rb +27 -0
  20. data/gemfiles/4.2.gemfile +21 -20
  21. data/gemfiles/4.2.gemfile.lock +143 -140
  22. data/gemfiles/5.0.gemfile +37 -0
  23. data/gemfiles/5.0.gemfile.lock +238 -0
  24. data/gemfiles/5.1.gemfile +38 -0
  25. data/gemfiles/5.1.gemfile.lock +254 -0
  26. data/gemfiles/5.2.gemfile +40 -0
  27. data/gemfiles/5.2.gemfile.lock +273 -0
  28. data/lib/shoulda/matchers/action_controller/callback_matcher.rb +18 -6
  29. data/lib/shoulda/matchers/action_controller/permit_matcher.rb +6 -1
  30. data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +1 -1
  31. data/lib/shoulda/matchers/action_controller/route_matcher.rb +87 -27
  32. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +1 -0
  33. data/lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setter.rb +0 -4
  34. data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +5 -0
  35. data/lib/shoulda/matchers/active_model/validate_acceptance_of_matcher.rb +5 -0
  36. data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +26 -11
  37. data/lib/shoulda/matchers/active_model/validate_exclusion_of_matcher.rb +39 -4
  38. data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +116 -47
  39. data/lib/shoulda/matchers/active_model/validate_length_of_matcher.rb +127 -38
  40. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +55 -37
  41. data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +30 -1
  42. data/lib/shoulda/matchers/active_model/validation_matcher.rb +11 -4
  43. data/lib/shoulda/matchers/active_model/validation_matcher/build_description.rb +11 -6
  44. data/lib/shoulda/matchers/active_record.rb +3 -0
  45. data/lib/shoulda/matchers/active_record/association_matcher.rb +172 -22
  46. data/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +1 -1
  47. data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +11 -6
  48. data/lib/shoulda/matchers/active_record/association_matchers/optional_matcher.rb +46 -0
  49. data/lib/shoulda/matchers/active_record/association_matchers/required_matcher.rb +51 -0
  50. data/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb +268 -38
  51. data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +1 -1
  52. data/lib/shoulda/matchers/active_record/have_secure_token_matcher.rb +111 -0
  53. data/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb +207 -79
  54. data/lib/shoulda/matchers/doublespeak/object_double.rb +5 -1
  55. data/lib/shoulda/matchers/independent/delegate_method_matcher.rb +100 -21
  56. data/lib/shoulda/matchers/rails_shim.rb +133 -52
  57. data/lib/shoulda/matchers/routing.rb +2 -2
  58. data/lib/shoulda/matchers/util.rb +23 -1
  59. data/lib/shoulda/matchers/util/word_wrap.rb +6 -2
  60. data/lib/shoulda/matchers/version.rb +1 -1
  61. data/script/install_gems_in_all_appraisals +3 -1
  62. data/script/run_all_tests +3 -1
  63. data/script/supported_ruby_versions +7 -0
  64. data/script/update_gem_in_all_appraisals +3 -1
  65. data/script/update_gems_in_all_appraisals +3 -1
  66. data/shoulda-matchers.gemspec +3 -3
  67. data/spec/acceptance/independent_matchers_spec.rb +2 -2
  68. data/spec/acceptance/multiple_libraries_integration_spec.rb +1 -1
  69. data/spec/acceptance/rails_integration_spec.rb +2 -2
  70. data/spec/spec_helper.rb +2 -3
  71. data/spec/support/acceptance/helpers.rb +2 -0
  72. data/spec/support/acceptance/helpers/command_helpers.rb +17 -4
  73. data/spec/support/acceptance/helpers/rails_migration_helpers.rb +21 -0
  74. data/spec/support/acceptance/helpers/step_helpers.rb +1 -1
  75. data/spec/support/tests/current_bundle.rb +3 -9
  76. data/spec/support/tests/filesystem.rb +2 -2
  77. data/spec/support/unit/attribute.rb +0 -2
  78. data/spec/support/unit/capture.rb +9 -3
  79. data/spec/support/unit/helpers/action_pack_versions.rb +22 -0
  80. data/spec/support/unit/helpers/active_model_versions.rb +4 -0
  81. data/spec/support/unit/helpers/active_record_versions.rb +22 -2
  82. data/spec/support/unit/helpers/active_resource_builder.rb +2 -2
  83. data/spec/support/unit/helpers/controller_builder.rb +1 -1
  84. data/spec/support/unit/helpers/message_helpers.rb +19 -0
  85. data/spec/support/unit/helpers/rails_versions.rb +14 -0
  86. data/spec/support/unit/matchers/fail_with_message_matcher.rb +7 -5
  87. data/spec/support/unit/matchers/print_warning_including.rb +21 -13
  88. data/spec/support/unit/model_creation_strategies/active_record.rb +1 -1
  89. data/spec/support/unit/model_creators/active_record.rb +0 -1
  90. data/spec/support/unit/model_creators/basic.rb +7 -2
  91. data/spec/support/unit/rails_application.rb +25 -0
  92. data/spec/support/unit/record_validating_confirmation_builder.rb +5 -2
  93. data/spec/support/unit/validation_matcher_scenario.rb +0 -2
  94. data/spec/unit/shoulda/matchers/action_controller/callback_matcher_spec.rb +18 -18
  95. data/spec/unit/shoulda/matchers/action_controller/permit_matcher_spec.rb +33 -5
  96. data/spec/unit/shoulda/matchers/action_controller/render_template_matcher_spec.rb +1 -1
  97. data/spec/unit/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +80 -78
  98. data/spec/unit/shoulda/matchers/active_model/allow_value_matcher_spec.rb +7 -9
  99. data/spec/unit/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb +28 -4
  100. data/spec/unit/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb +19 -1
  101. data/spec/unit/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +27 -4
  102. data/spec/unit/shoulda/matchers/active_model/validate_exclusion_of_matcher_spec.rb +62 -5
  103. data/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +52 -18
  104. data/spec/unit/shoulda/matchers/active_model/validate_length_of_matcher_spec.rb +51 -4
  105. data/spec/unit/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +99 -71
  106. data/spec/unit/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +41 -15
  107. data/spec/unit/shoulda/matchers/active_record/association_matcher_spec.rb +445 -15
  108. data/spec/unit/shoulda/matchers/active_record/define_enum_for_matcher_spec.rb +615 -93
  109. data/spec/unit/shoulda/matchers/active_record/have_secure_token_matcher_spec.rb +169 -0
  110. data/spec/unit/shoulda/matchers/active_record/validate_uniqueness_of_matcher_spec.rb +167 -97
  111. data/spec/unit/shoulda/matchers/doublespeak/world_spec.rb +2 -4
  112. data/spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb +152 -19
  113. data/spec/unit/shoulda/matchers/routing/route_matcher_spec.rb +258 -94
  114. data/spec/unit_spec_helper.rb +9 -1
  115. data/zeus.json +1 -1
  116. metadata +31 -16
  117. data/gemfiles/4.0.0.gemfile +0 -38
  118. data/gemfiles/4.0.0.gemfile.lock +0 -223
  119. data/gemfiles/4.0.1.gemfile +0 -38
  120. data/gemfiles/4.0.1.gemfile.lock +0 -225
  121. data/gemfiles/4.1.gemfile +0 -38
  122. data/gemfiles/4.1.gemfile.lock +0 -220
  123. data/script/SUPPORTED_VERSIONS +0 -1
@@ -0,0 +1,250 @@
1
+ # Maintaining Shoulda Matchers
2
+
3
+ As maintainers of the gem, this is our guide. Most of the steps and guidelines
4
+ in the [Contributing](CONTRIBUTING.md) document apply here, including how to set
5
+ up your environment, write code to fit the code style, run tests, craft commits
6
+ and manage branches. Beyond this, this document provides some details that would
7
+ be too low-level for contributors.
8
+
9
+ ## Communication
10
+
11
+ We use a combination of methods to communicate with each other:
12
+
13
+ * In planning major releases, it can be helpful to create a **new issue**
14
+ outlining the changes as well as steps needed to launch the release. This
15
+ serves both as an announcement to the community as well as an area to keep a
16
+ checklist.
17
+ * To track progress for the next release, **GitHub milestones** are useful.
18
+ * To track progress on the movement of issues, [**labels**](#addendum-labels)
19
+ are useful.
20
+ * To communicate small-scale changes, **pull requests** are effective, as
21
+ mentioned above.
22
+ * To communicate large-scale changes or explain topics, **email** is best.
23
+
24
+ ## Managing the community
25
+
26
+ As anyone who has played a sim game before, it's important to make your patrons
27
+ happy. We do this by:
28
+
29
+ * Answering questions from members of the community
30
+ * Closing stale issues and feature requests
31
+ * Keeping the community informed by ensuring that the changelog is up to date
32
+ * Ensuring that the inline documentation, as well as the docsite, is kept up to
33
+ date
34
+
35
+ ## Workflow
36
+
37
+ We generally follow [GitHub Flow]. The `master` branch is the main line, and all
38
+ branches are cut from and get merged back into this branch. Generally, the
39
+ workflow is as follows:
40
+
41
+ [GitHub Flow]: https://help.github.com/articles/github-flow/
42
+
43
+ * Cut a feature or bugfix branch from this branch.
44
+ * Upon completing a branch, create a PR and ask another maintainer to approve
45
+ it.
46
+ * Try to keep the commit history as clean as possible. Before merging, squash
47
+ "WIP" or related commits together and rebase as needed.
48
+ * Once your PR is approved and you've cleaned up your branch, you're free to
49
+ merge it in.
50
+
51
+ ## Architecture
52
+
53
+ Besides the matchers, there are files in `lib` which you may need to reference
54
+ or update:
55
+
56
+ * `lib/shoulda/matchers/doublespeak*` -- a small handrolled mocking library
57
+ which is used by the `permit` matcher
58
+ * `lib/shoulda/matchers/util*` -- extra methods which are used in various places
59
+ to detect library versions, wrap/indent text, and more
60
+
61
+ ## Updating the changelog
62
+
63
+ After every user-facing change makes it into master, we make a note of it in the
64
+ changelog, which for historical reasons is kept in `NEWS.md`. The changelog is
65
+ sorted in reverse order by release version, with the topmost version as the next
66
+ release (tagged as "(Unreleased)").
67
+
68
+ Within each version, there are five available categories you can divide changes
69
+ into. They are all optional but they should appear in this order:
70
+
71
+ 1. Backward-compatible changes
72
+ 1. Deprecations
73
+ 1. Bug fixes
74
+ 1. Features
75
+ 1. Improvements
76
+
77
+ Within each category section, the changes relevant to that category are listed
78
+ in chronological order.
79
+
80
+ For each change, provide a human-readable description of the change as well as a
81
+ linked reference to the PR where that change emerged (or the commit ID if no
82
+ such PR is available). This helps users cross-reference changes if they need to.
83
+
84
+ ## Documentation
85
+
86
+ ### Generating documentation
87
+
88
+ As mentioned in the Contributing document, we use YARD for documentation. YARD
89
+ is configured via `.yardopts` to process the Ruby files in `lib/` as well as
90
+ `NEWS.md` and the Markdown files in `docs/` and write the documentation in HTML
91
+ form to `doc`. This command will do exactly that:
92
+
93
+ ```bash
94
+ bundle exec yard doc
95
+ ```
96
+
97
+ However, if you're actively updating the documentation, it's more helpful to
98
+ launch a process that will watch the aforementioned source files for changes and
99
+ generate the HTML for you automatically:
100
+
101
+ ```bash
102
+ bundle exec rake docs:autogenerate
103
+ ```
104
+
105
+ Whichever approach you take, you can view the generated docs locally by running:
106
+
107
+ ```bash
108
+ open doc/index.html
109
+ ```
110
+
111
+ ### About the docsite
112
+
113
+ The docfiles that YARD generates are published to the docsite, which is located
114
+ at:
115
+
116
+ <https://matchers.shoulda.io/docs>
117
+
118
+ The docsite is hosted on GitHub Pages*. As such, the `gh-pages` branch hosts the
119
+ code for the docsite. This branch is written to automatically by the
120
+ `docs:publish` and `docs:publish_latest` tasks.
121
+
122
+ The URL above actually links to a bare-bones HTML page which merely serves to
123
+ automatically redirect the visitor to the docs for the latest published version
124
+ of the gem. This version is hardcoded in the HTML page, but is also updated
125
+ automatically by the `docs:publish` and `docs:publish_latest` tasks.
126
+
127
+ *\* thoughtbot owns <https://shoulda.io>, and
128
+ they've got `matchers.shoulda.io` set up on the DNS level as an alias for
129
+ `thoughtbot.github.io/shoulda-matchers`.*
130
+
131
+ ## Versioning
132
+
133
+ ### Naming a new version
134
+
135
+ As designated in the README, we follow [SemVer 2.0][semver]. This offers a
136
+ meaningful baseline for deciding how to name versions. Generally speaking:
137
+
138
+ [semver]: https://semver.org/spec/v2.0.0.html
139
+
140
+ * We bump the "major" part of the version if we're introducing
141
+ backward-incompatible changes (e.g. changing the API or core behavior,
142
+ removing parts of the API, or dropping support for a version of Ruby).
143
+ * We bump the "minor" part if we're adding a new feature (e.g. adding a new
144
+ matcher or adding a new qualifier to a matcher).
145
+ * We bump the "patch" part if we're merely including bugfixes.
146
+
147
+ In addition to major, minor, and patch levels, you can also append a
148
+ suffix to the version for pre-release versions. We usually use this to issue
149
+ release candidates prior to an actual release. A version number in this case
150
+ might look like `4.0.0.rc1`.
151
+
152
+ ### Releasing a new version
153
+
154
+ Releasing a new version is very simple:
155
+
156
+ 1. First, you'll want to be given ownership permissions for the Ruby gem itself.
157
+ If you want to give someone else these rights, you can use:
158
+
159
+ ```bash
160
+ gem owner shoulda-matchers -a <email address>
161
+ ```
162
+ 1. Next, you'll want to update the `VERSION` constant in
163
+ `lib/shoulda/matchers/version.rb`. This constant is referenced in the gemspec
164
+ and is used in the Rake tasks to publish the gem on RubyGems as well as
165
+ generate documentation.
166
+ 1. Finally, you'll want to run:
167
+
168
+ ```bash
169
+ rake release
170
+ ```
171
+
172
+ This will not only push the gem to RubyGems, but also update the docsite.
173
+
174
+ ### Re-publishing docs
175
+
176
+ In general you'll use the `release` task to update the docsite, but there may be
177
+ a situation where you'll need to do it manually.
178
+
179
+ You can re-publish the docs for the latest version (as governed by
180
+ `lib/shoulda/matchers/version.rb`) by running:
181
+
182
+ ```bash
183
+ bundle exec rake docs:publish_latest
184
+ ```
185
+
186
+ This will update the version to which the docsite auto-redirects to the latest
187
+ version. For instance, if the latest version were 4.0.0, this command would
188
+ publish the docs at <https://matchers.shoulda.io/docs/v4.0.0> but redirect
189
+ <https://matchers.shoulda.io/docs> to this location.
190
+
191
+ However, if you want to publish the docs for a version and at the same
192
+ time manually set the auto-redirected version, you can run this instead:
193
+
194
+ ```bash
195
+ bundle exec rake docs:publish[version, latest_version]
196
+ ```
197
+
198
+ Here, `version` and `latest_version` are both version strings. For instance, you
199
+ might say:
200
+
201
+ ```bash
202
+ bundle exec rake docs:publish[4.0.0, 3.7.2]
203
+ ```
204
+
205
+ This would publish the docs for 4.0.0 at
206
+ <https://matchers.shoulda.io/docs/v4.0.0>, but redirect
207
+ <https://matchers.shoulda.io/docs> to <https://matchers.shoulda.io/docs/v3.7.2>.
208
+
209
+ ## Addendum: Labels
210
+
211
+ In order to corral the issue and PR backlog, we've found
212
+ [labels] to be useful for cataloguing and tracking progress purposes. Over time
213
+ we've added quite a collection of labels. Here's a quick list:
214
+
215
+ [labels]: https://github.com/thoughtbot/shoulda-matchers/labels
216
+
217
+ ### Labels for issues
218
+
219
+ * **Issue: Bug**
220
+ * **Issue: Feature Request**
221
+ * **Issue: Need to Investigate** -- if we don't know whether a bug is legitimate
222
+ or not
223
+ * **Issue: PR Needed** -- perhaps unnecessary, but it does signal to the
224
+ community that we'd love a PR
225
+
226
+ ### Labels for PRs
227
+
228
+ * **PR: Bugfix**
229
+ * **PR: Feature**
230
+ * **PR: Good to Merge** -- most of the time not necessary, but can be helpful in
231
+ a code freeze before a release to mark PRs that we will include in the next
232
+ release
233
+ * **PR: In Progress** -- used to mark PRs that are still being worked on by the
234
+ PR author
235
+ * **PR: Needs Documentation**
236
+ * **PR: Needs Review**
237
+ * **PR: Needs Tests**
238
+ * **PR: Needs Updates Before Merge** -- along the same lines as the other
239
+ "Needs" tags, but more generic
240
+
241
+ ### Generic labels
242
+
243
+ * **Blocked**
244
+ * **Documentation**
245
+ * **Needs Decision**
246
+ * **Needs Revisiting**
247
+ * **Question**
248
+ * **Rails X**
249
+ * **Ruby X.Y**
250
+ * **UX**
@@ -1,4 +1,4 @@
1
- Copyright (c) 2006-2016, Tammer Saleh, thoughtbot, inc.
1
+ Copyright (c) 2006-2018, Tammer Saleh and thoughtbot, inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/NEWS.md CHANGED
@@ -1,15 +1,183 @@
1
- # 3.1.3
1
+ # 4.0.0 (unreleased)
2
+
3
+ This release mainly brings the gem up to date with modern versions of Ruby and
4
+ Rails and drops support for older, unsupported versions. The compatibility list
5
+ is now:
6
+
7
+ * **Ruby:** 2.5.1, 2.4.4, 2.3.7, 2.2.8
8
+ * **Rails:** 5.2.1, 5.1.6, 5.0.6, 4.2.9
9
+
10
+ ### Backward-incompatible changes
11
+
12
+ * Drop support for Rails 4.0 and 4.1 as well as Ruby 2.0 and 2.1, since they've
13
+ been end-of-lifed. The gem now supports Ruby 2.2+ and Rails 4.2+.
14
+
15
+ * `use_before_filter`, `use_after_filter`, and `use_around_filter` are no longer
16
+ usable when using shoulda-matchers under Rails 5.x, as the corresponding
17
+ controller callbacks don't exist there.
18
+
19
+ * *PR: [#1054]*
20
+
21
+ ### Deprecations
22
+
23
+ * `define_enum_for`: `with` is deprecated in favor of `with_values`. This is to
24
+ prevent confusion with `with_prefix` and `with_suffix`, which are new.
25
+
26
+ * *PR: [#1077]*
27
+
28
+ ### Bug fixes
29
+
30
+ * Fix association matchers when used under Rails 5.x so that they make use of
31
+ `ActiveRecord::Base.connection.data_sources` instead of
32
+ `ActiveRecord::Base.connection.tables`, which was deprecated.
33
+
34
+ * *Commit: [61c3654]*
35
+ * *PR: [#943]*
36
+ * *Original issue: [#933]*
37
+
38
+ * Fix the `serialize` matcher so that it works with Rails 5.x.
39
+
40
+ * *Commit: [df04f87]*
41
+ * *PR: [#965]*
42
+ * *Original issue: [#913]*
43
+
44
+ * Fix our custom mocking library Doublespeak, which is used by
45
+ `delegate_method`, so that it does not produce a warning under Ruby 2.4.
46
+
47
+ * *Commit: [8d7dcb8]*
48
+ * *PR: [#1038]*
49
+ * *Original issue: [#1006]*
50
+
51
+ * Fix the `permit` matcher so that it uses the correct method signature to call
52
+ the controller action with params in order to prevent a warning under Rails
53
+ 5.x.
54
+
55
+ * *Commit: [ce9624b]*
56
+ * *PRs: [#989], [#964], [#917]*
57
+ * *Original issue: [#867]*
58
+
59
+ * Fix the `define_enum_for` matcher so that it once more allows string columns
60
+ to be used as enum attributes.
61
+
62
+ * *Commit: [5650aae]*
63
+ * *PR: [#1063]*
64
+ * *Original issue: [#912]*
65
+
66
+ * Fix `validate_uniqueness_of` when used under Rails 4.2 so that when the
67
+ attribute you're testing is a boolean column, it will no longer emit a
68
+ warning.
69
+
70
+ * *PR: [#1073]*
71
+ * *Original issue: [#949]*
72
+
73
+ * Fix `validate_inclusion_of` so that if it fails, it will no longer blow up
74
+ with the error "undefined method \`attribute_setter' for nil:NilClass".
75
+
76
+ * *Original issue: [#904]*
77
+
78
+ * Add negative versions of all validation matchers (i.e. implement
79
+ `does_not_match?` for them) to prevent them from blowing up with
80
+ "undefined method \`attribute_setter' for nil:NilClass".
81
+
82
+ * *Original issue: [#904]*
83
+
84
+ ### Features
85
+
86
+ * Add `required` and `optional` qualifiers to `belong_to` and `have_one`
87
+ matchers. (When using the `belong_to` matcher under Rails 5+, `required` is
88
+ assumed unless overridden.)
89
+
90
+ * *Commit: [3af3d9f]*
91
+ * *Original PR: [#956]*
92
+ * *Original issues: [#870], [#861]*
93
+
94
+ * Add `allow_nil` qualifier to `delegate_method`.
95
+
96
+ * *Commit: [d49cfca]*
97
+ * *Original PR: [#798]*
98
+
99
+ * Add `allow_nil` qualifier to `validate_length_of`.
100
+
101
+ * *Original PR: [#724]*
102
+
103
+ * Add a `port` option to the `route` matcher to allow testing a route that has
104
+ a constraint on it such that only a specific port may be used to access that
105
+ route.
106
+
107
+ * *PRs: [#1074], [#1075]*
108
+ * *Original issue: [#954]*
109
+
110
+ * Add `with_prefix` and `with_suffix` to `define_enum_for` to allow testing
111
+ the `enum` macro with corresponding `prefix` and `suffix` options (Rails 5
112
+ only).
113
+
114
+ * *PR: [#1077]
115
+ * *Original issue: [#961]
116
+
117
+ * Add `index_errors` option to `has_many` (Rails 5 only).
118
+
119
+ * *Commit: [795ca68]*
120
+ * *PR: [#1089]*
121
+
122
+ [a6d09aa]: https://github.com/thoughtbot/shoulda-matchers/commit/a6d09aa5de0d546367e7b3d7177dfde6c66f7f05
123
+ [#943]: https://github.com/thoughtbot/shoulda-matchers/pulls/943
124
+ [#933]: https://github.com/thoughtbot/shoulda-matchers/issues/933
125
+ [df04f87]: https://github.com/thoughtbot/shoulda-matchers/commit/df04f8704abc3754c63c488433dac8c30573da6b
126
+ [#965]: https://github.com/thoughtbot/shoulda-matchers/pulls/965
127
+ [#913]: https://github.com/thoughtbot/shoulda-matchers/issues/913
128
+ [8d7dcb8]: https://github.com/thoughtbot/shoulda-matchers/commit/8d7dcb88c3bae8315e4107a39ae17fe19a4b6786
129
+ [#1038]: https://github.com/thoughtbot/shoulda-matchers/pulls/1038
130
+ [#1006]: httpce9624b3c5a08b9134150e228440c771d95782b7s://github.com/thoughtbot/shoulda-matchers/issues/1006
131
+ [ce9624b]: https://github.com/thoughtbot/shoulda-matchers/commit/ce9624b3c5a08b9134150e228440c771d95782b7
132
+ [#989]: https://github.com/thoughtbot/shoulda-matchers/pulls/989
133
+ [#964]: https://github.com/thoughtbot/shoulda-matchers/pulls/964
134
+ [#917]: https://github.com/thoughtbot/shoulda-matchers/pulls/917
135
+ [#867]: https://github.com/thoughtbot/shoulda-matchers/issues/867
136
+ [#1054]: https://github.com/thoughtbot/shoulda-matchers/pulls/1054
137
+ [5650aae]: https://github.com/thoughtbot/shoulda-matchers/commit/5650aae35de85aeabd75bc544324fda33ce1a092
138
+ [#1063]: https://github.com/thoughtbot/shoulda-matchers/pulls/1063
139
+ [#912]: https://github.com/thoughtbot/shoulda-matchers/issues/912
140
+ [#1073]: https://github.com/thoughtbot/shoulda-matchers/pulls/1073
141
+ [#949]: https://github.com/thoughtbot/shoulda-matchers/issues/949
142
+ [d49cfca]: https://github.com/thoughtbot/shoulda-matchers/commit/d49cfcae1b294e12a05e06a5612cb8ebb22a7df1
143
+ [#798]: https://github.com/thoughtbot/shoulda-matchers/pulls/798
144
+ [#724]: https://github.com/thoughtbot/shoulda-matchers/issues/724
145
+ [d49cfca]: https://github.com/thoughtbot/shoulda-matchers/commit/d49cfcae1b294e12a05e06a5612cb8ebb22a7df1
146
+ [3af3d9f]: https://github.com/thoughtbot/shoulda-matchers/commit/3af3d9f7abb768c063759941724ccae48c7b76d6
147
+ [#956]: https://github.com/thoughtbot/shoulda-matchers/pulls/956
148
+ [#870]: https://github.com/thoughtbot/shoulda-matchers/issues/870
149
+ [#861]: https://github.com/thoughtbot/shoulda-matchers/issues/861
150
+ [#954]: https://github.com/thoughtbot/shoulda-matchers/issues/954
151
+ [#1074]: https://github.com/thoughtbot/shoulda-matchers/pulls/1074
152
+ [#1075]: https://github.com/thoughtbot/shoulda-matchers/pulls/1075
153
+ [#1077]: https://github.com/thoughtbot/shoulda-matchers/pulls/1077
154
+ [#961]: https://github.com/thoughtbot/shoulda-matchers/issues/961
155
+ [795ca68]: https://github.com/thoughtbot/shoulda-matchers/commit/795ca688bff08590dbd2ab6f2b51ea415e0c7473
156
+ [#1089]: https://github.com/thoughtbot/shoulda-matchers/pulls/1089
157
+ [#904]: https://github.com/thoughtbot/shoulda-matchers/issues/904
2
158
 
3
159
  ### Improvements
4
160
 
5
- * Update `BigDecimal.new()` to use `BigDecimal()` and avoid deprecation warnings
6
- in Ruby 2.6.
161
+ * Replace usage of Fixnum with Integer to prevent Ruby 2.4 from emitting
162
+ deprecation warnings.
163
+
164
+ * *Commits: [61c3654], [03a1d21]*
165
+ * *PRs: [#1040], [#1031], [#1009]*
166
+ * *Original issue: [#1001]*
167
+
168
+ [61c3654]: https://github.com/thoughtbot/shoulda-matchers/commit/61c365416a09c5cffd7fcb774a07de4abf8e9afd
169
+ [03a1d21]: https://github.com/thoughtbot/shoulda-matchers/commit/03a1d213805a44a0aec99857e01cab8524aa0c05
170
+ [#1040]: https://github.com/thoughtbot/shoulda-matchers/pulls/1040
171
+ [#1031]: https://github.com/thoughtbot/shoulda-matchers/pulls/1031
172
+ [#1009]: https://github.com/thoughtbot/shoulda-matchers/pulls/1009
173
+ [#1001]: https://github.com/thoughtbot/shoulda-matchers/issues/1001
7
174
 
8
175
  # 3.1.2
9
176
 
10
177
  ### Deprecations
11
178
 
12
- * This is the **last version** that supports Rails 4.0 and 4.1 and Ruby 2.0 and 2.1.
179
+ * This is the **last version** that supports Rails 4.0 and 4.1 and Ruby 2.0 and
180
+ 2.1.
13
181
 
14
182
  ### Bug fixes
15
183
 
@@ -23,6 +191,10 @@
23
191
  * *Issue: [#899]*
24
192
  * *Pull request: [#902]*
25
193
 
194
+ [44c019]: https://github.com/thoughtbot/shoulda-matchers/commit/44c0198830921650af3b4a56f5d72aaae2168480
195
+ [#899]: https://github.com/thoughtbot/shoulda-matchers/issues/899
196
+ [#902]: https://github.com/thoughtbot/shoulda-matchers/pulls/902
197
+
26
198
  # 3.1.1
27
199
 
28
200
  ### Bug fixes