You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for ConditionalUsingTest currently reads as:
Use ::File.exist?('/foo/bar') instead of the slower 'test -f /foo/bar' which requires shelling out
However, it doesn't mention that the ruby code should be passed as a block. If you're like me and read the suggestion as-is, you might write:
...
not_if ::File.exist?('/foo/bar')
...
... which will then throw an error ArgumentError: Invalid only_if/not_if command, expected a string: true (TrueClass) if the file exists. Passing as a block:
...
not_if{ ::File.exist?('/foo/bar')}
...
... is the intention of the cop.
The text was updated successfully, but these errors were encountered:
The documentation for ConditionalUsingTest currently reads as:
However, it doesn't mention that the ruby code should be passed as a block. If you're like me and read the suggestion as-is, you might write:
... which will then throw an error
ArgumentError: Invalid only_if/not_if command, expected a string: true (TrueClass)
if the file exists. Passing as a block:... is the intention of the cop.
The text was updated successfully, but these errors were encountered: