Module: Capybara::Selenium::DeprecationSuppressor

Defined in:
lib/capybara/selenium/logger_suppressor.rb

Instance Method Summary collapse

Instance Method Details

#deprecate(*args, **opts, &block) ⇒ Object


11
12
13
14
15
16
17
18
19
# File 'lib/capybara/selenium/logger_suppressor.rb', line 11

def deprecate(*args, **opts, &block)
  return if @suppress_for_capybara

  if opts.empty?
    super(*args, &block) # support Selenium 3
  else
    super
  end
end

#initializeObject


6
7
8
9
# File 'lib/capybara/selenium/logger_suppressor.rb', line 6

def initialize(*)
  @suppress_for_capybara = false
  super
end

#suppress_deprecationsObject


21
22
23
24
25
26
# File 'lib/capybara/selenium/logger_suppressor.rb', line 21

def suppress_deprecations
  prev_suppress_for_capybara, @suppress_for_capybara = @suppress_for_capybara, true
  yield
ensure
  @suppress_for_capybara = prev_suppress_for_capybara
end