Only warn about #default_wait_time deprecation once

This commit is contained in:
Thomas Walpole 2015-06-09 10:02:52 -07:00
parent 2be3cbb19a
commit e5c5991bd3
1 changed files with 5 additions and 3 deletions

View File

@ -298,7 +298,7 @@ module Capybara
# @deprecated Use default_max_wait_time instead
def default_wait_time
deprecate('default_wait_time', 'default_max_wait_time')
deprecate('default_wait_time', 'default_max_wait_time', true)
default_max_wait_time
end
@ -313,8 +313,10 @@ module Capybara
warn "`include Capybara` is deprecated. Please use `include Capybara::DSL` instead."
end
def deprecate(method, alternate_method)
warn "DEPRECATED: ##{method} is deprecated, please use ##{alternate_method} instead"
def deprecate(method, alternate_method, once=false)
@deprecation_notified ||= {}
warn "DEPRECATED: ##{method} is deprecated, please use ##{alternate_method} instead" unless once and @deprecation_notified[method]
@deprecation_notified[method]=true
end
private