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
autocorrect for new Style/ClassEqualityComparison cop incorrectly leaves string
class.name == 'Capybara::RackTest::Driver' becomes instance_of?('Capybara::RackTest::Driver') instead of instance_of?(Capybara::RackTest::Driver)
Expected behavior
run of Style/ClassEqualityComparison should replace class name string with class rather than leaving the class string instance_of?(Capybara::RackTest::Driver) - without the single quotes is a valid method call
Actual behavior
C: [Corrected] Style/ClassEqualityComparison: Use Object.instance_of? instead of comparing classes.
page.driver.class.name == 'Capybara::RackTest::Driver'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Steps to reproduce the problem
class Example
page.driver.class.name == 'Capybara::RackTest::Driver'
end
run rubocop -a
becomes
class Example
page.driver.instance_of?('Capybara::RackTest::Driver')
end
autocorrect for new Style/ClassEqualityComparison cop incorrectly leaves string
class.name == 'Capybara::RackTest::Driver'
becomesinstance_of?('Capybara::RackTest::Driver')
instead ofinstance_of?(Capybara::RackTest::Driver)
Expected behavior
run of Style/ClassEqualityComparison should replace class name string with class rather than leaving the class string
instance_of?(Capybara::RackTest::Driver)
- without the single quotes is a valid method callActual behavior
Steps to reproduce the problem
run
rubocop -a
becomes
RuboCop version
The text was updated successfully, but these errors were encountered: