2017-02-06 16:06:49 -05:00
|
|
|
inherit_from: .hound/ruby.yml
|
|
|
|
Style/AlignParameters:
|
2015-01-03 20:19:00 -05:00
|
|
|
EnforcedStyle: with_fixed_indentation
|
2017-02-06 16:06:49 -05:00
|
|
|
Style/CollectionMethods:
|
Rewrite tests for validate_uniqueness_of
* The main problem I had with the old tests is that information that
the reader didn't need to care about was not properly abstracted away.
For instance, a helper method used by almost all tests will always
create a model called Example, and will always use an attribute called
"attr" (on which the validation is present). However, in some tests
the class or attribute is referred to directly. The reader shouldn't
have to care about either of these things, since they are constant --
the tests should be readable enough so that this information is not
necessary to understand the case being tested against.
* Speaking of this helper method, some of the tests used it and some
didn't. Some defined their own helper methods to represent a
particular case (`case_sensitive: true`, `allow_nil`, etc.). This is
now fixed so that all but two tests use the same helper method to
define a model. This model is completely customizable -- one can
specify the type of the attribute being validated, the names and types
of scoped attributes, etc.
* The tests around scoped attributes and different types are all
basically the same, so they are now compressed into a shared context.
* Related to this, we no longer have to worry about setting a proper
value for a scope attribute. One had to know which type that attribute
had and come up with a reasonable default for that type. Now there is
a helper method that worries about this automatically.
* Finally, we remove tests around case_insensitive against an integer
attribute (these don't make any sense, and don't work).
2015-02-08 14:10:23 -05:00
|
|
|
PreferredMethods:
|
|
|
|
find: detect
|
|
|
|
reduce: inject
|
|
|
|
collect: map
|
|
|
|
find_all: select
|
2017-02-06 16:06:49 -05:00
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
Enabled: false
|
|
|
|
Style/StringLiterals:
|
|
|
|
EnforcedStyle: single_quotes
|