prefer &. to .try

This commit is contained in:
Mike Greiling 2018-04-13 10:50:01 -05:00
parent 960e2065f9
commit 9cf9cc8ee7
No known key found for this signature in database
GPG Key ID: 0303DF507FA67596
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ RSpec.configure do |config|
config.after(:example, :js) do |example|
# when a test fails, display any messages in the browser's console
if example.exception
console = page.driver.browser.manage.logs.get(:browser).try(:reject) { |log| log.message =~ JS_CONSOLE_FILTER }
console = page.driver.browser.manage.logs.get(:browser)&.reject { |log| log.message =~ JS_CONSOLE_FILTER }
if console.present?
message = "Unexpected browser console output:\n" + console.map(&:message).join("\n")
raise JSConsoleError, message