summaryrefslogtreecommitdiff
path: root/spec/support/capybara.rb
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-04-13 10:50:01 -0500
committerMike Greiling <mike@pixelcog.com>2018-04-13 10:50:01 -0500
commit9cf9cc8ee729c1066d3670159931c5a5ce1ddc93 (patch)
tree2f2ed695574965f63e6751d402a25018b06a1760 /spec/support/capybara.rb
parent960e2065f923e14e40651686eb9aafa38e5d748b (diff)
downloadgitlab-ce-9cf9cc8ee729c1066d3670159931c5a5ce1ddc93.tar.gz
prefer &. to .try
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r--spec/support/capybara.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index e0fb4b83229..9ddcc5f2fbf 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -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