Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^the ([^"]*) of "([^"]*)" should be "([^"]*)"$/ do |arg1, arg2, arg3|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^the "([^"]*)" field(?: within (.*))? for equipment rentals should contain "([^"]*)"$/ do |field, parent, value|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^the ([^"]*) should receive a confirmation email containing the file "([^"]*)"$/ do |arg1, arg2|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Unused block argument - f
. You can omit the argument if you don't care about it. Open
fields.each do |f|
- Read upRead up
- Exclude checks
This cop checks for unused block arguments.
Example:
# bad
do_something do |used, unused|
puts used
end
do_something do |bar|
puts :foo
end
define_method(:foo) do |bar|
puts :baz
end
Example:
#good
do_something do |used, _unused|
puts used
end
do_something do
puts :foo
end
define_method(:foo) do |_bar|
puts :baz
end
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
When /^(?:|I )select "([^"]*)" for equipment rentals from "([^"]*)"$/ do |value, field|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
When /I should see the following (.*): (.*)/ do |inputtype, fieldlist|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
When /^I attach the file "([^"]*)"$/ do |file|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /as "([^"]*)", I should receive a confirmation at "([^"]*)"/ do |who, email|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
Then /^the ([^"]*) of "([^"]*)" in the csv should be "([^"]*)"$/ do |arg1, arg2, arg3|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
And /I should also be able to see their submission/ do
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)
Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the /
if it should be a division. Open
And /I use the email "([^"]*)"/ do |email|
- Read upRead up
- Exclude checks
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Example:
# bad
# This is interpreted as a method invocation with a regexp literal,
# but it could possibly be `/` method invocations.
# (i.e. `do_something./(pattern)./(i)`)
do_something /pattern/i
Example:
# good
# With parentheses, there's no ambiguity.
do_something(/pattern/i)