prefer &. to .try
This commit is contained in:
parent
960e2065f9
commit
9cf9cc8ee7
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue