Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

[Solved] How to solve "Align the operands of a condition in an unless statement spanning multiple lines" error

[SOLVED] How to deal with "C: Align the operands of a condition in an unless statement spanning multiple lines" error from Rubocop


Below is the problem statement.
C: Align the operands of a condition in an unless statement spanning multiple lines
Rubocop throws this as an error when the operands are not align correctly
Below the simpler way to look at it and how to resolve it.
Solution:
@bad Code
fail('Title not Present') unless
NewPage.page.title1.exists? ||
NewPage.page.title2.exists?
@good Code
fail('Title not Present') unless
NewPage.page.title1.exists? ||
NewPage.page.title2.exists?
Get Amazon Gift Cards for your friends and relatives: here


This post first appeared on G33K-TRICKS - Your Source To Tips And Tricks, please read the originial post: here

Share the post

[Solved] How to solve "Align the operands of a condition in an unless statement spanning multiple lines" error

×

Subscribe to G33k-tricks - Your Source To Tips And Tricks

Get updates delivered right to your inbox!

Thank you for your subscription

×