-
Notifications
You must be signed in to change notification settings - Fork 21.7k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,4 +47,9 @@ def test_in_module | |
def test_no_method_catching | ||
assert_raise(ArgumentError) { 1.in?(1) } | ||
end | ||
|
||
def test_present_in | ||
assert_equal "stuff", "stuff".present_in(%w( lots of stuff )) | ||
assert_not "stuff".present_in(%w( lots of crap )) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dhh
via email
Author
Member
|
||
end | ||
end |
3 comments
on commit 4edca10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is essentially the 'inclusion' form of Object#presence
, wouldn't this method's name be more consistent if it were named presence_in
?
The present_in
name sounds very much like Object#present?
, and while present_in
isn't interrogative, it still sounds like it would return a boolean, like present?
, rather than self
, like presence
.
Thanks for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should in here be
assert_nil
instead?