Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make assert_select_rjs code more readable, make use of unused constan…
…ts and use more simple Regexps. [#540 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
- Loading branch information
Showing
2 changed files
with
31 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11eb29f
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.
The following test fails as of this commit:
See http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/982 for more info.
11eb29f
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.
fwiw, if we’re talking about making code more readable, I don’t understand why people ever have ternary expressions that can return nil.
args.shift if args.first.is_a?(Symbol)
seems better for readability than
args.first.is_a?(Symbol) ? args.shift : nil
11eb29f
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.
granted, you’d have to do it like
foo = (bar if baz)
for the example here, which is maybe a little weird. I think I was thinking of situations where I did this behavior when assigning ivars, which of course relies on their defaulting to nil anyway.
so probably nevermind my ill conceived comment.
sheepish