1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
Commit graph

7 commits

Author SHA1 Message Date
Kapil Sachdev
cdcef128cf fix(rubocop): Add trailing comma in args, Hash and Arrays [ci skip]
- Satisfies Style/TrailingCommaInArguments, 
Style/TrailingCommaInArrayLiteral and Style/TrailingCommaInHashLiteral
2020-11-03 10:05:25 -07:00
Kapil Sachdev
97722f67cb fix(rubocop): Satisfy Style/StringLiterals with single_quotes [ci skip] 2020-11-03 10:05:25 -07:00
Elliot Winkler
00a84c0bfe Update documentation
[ci skip]
2019-02-16 03:01:35 -07:00
Elliot Winkler
f67183ea59 Improve the word_wrap utility method
We use the word_wrap method right now to reformat warning messages so
that they fit within a 72-character space. We'd like to use this for
error messages too, but we want the word_wrap method to be smart when
reformatting bulleted or numbered lists, and also to ignore code blocks.
2015-10-08 21:30:41 -06:00
Elliot Winkler
15d0cee93b Deprecate ensure_inclusion_of 2014-07-23 19:35:20 -06:00
Elliot Winkler
c22d7c89e0 Extract examples in README to inline documentation 2014-06-20 16:41:27 -06:00
Elliot Winkler
5b44edf8b3 Handle ensure_inclusion_of for boolean columns
Currently, using `ensure_inclusion_of` against a boolean column doesn't
work. We can assert that the column allows boolean values, but what
about values that should be rejected? Well, it depends on what you give
to `ensure_inclusion_of`. Here's how it works now:

* `ensure_inclusion_of(:attr).in_array([true])` asserts that false is
  rejected
* `ensure_inclusion_of(:attr).in_array([false])` asserts that true is
  rejected
* `ensure_inclusion_of(:attr).in_array([true, false])` does not assert
  that anything is rejected, instead informing the developer how
  this sort of expectation is not fully testable (anything other than
  true, false, or nil will be converted to false).
* `ensure_inclusion_of(:attr).in_array([nil])`, when the column is
  nullable, does not assert that anything is rejected, either, also
  printing a warning
* `ensure_inclusion_of(:attr).in_array([nil])`, when the column is
  non-nullable, raises an error because this expectation is not testable
  in any way, as setting a boolean column to nil this way will get
  converted to false.
2014-02-17 15:40:18 -07:00