Module: RSpec::Core::FilterManager::BackwardCompatibility

Defined in:
lib/rspec/core/filter_manager.rb

Instance Method Summary collapse

Instance Method Details

#_warn_deprecated_key(key, updates) ⇒ Object

Emits a deprecation warning for keys that will not be supported in the future.



109
110
111
112
# File 'lib/rspec/core/filter_manager.rb', line 109

def _warn_deprecated_key(key, updates)
  RSpec.deprecate("FilterManager#exclude(#{key.inspect} => #{updates[key].inspect})")
  @exclusions[key] = updates.delete(key)
end

#_warn_deprecated_keys(updates) ⇒ Object

Supports a use case that probably doesn't exist: overriding the if/unless procs.



102
103
104
105
# File 'lib/rspec/core/filter_manager.rb', line 102

def _warn_deprecated_keys(updates)
  _warn_deprecated_key(:unless, updates) if updates.has_key?(:unless)
  _warn_deprecated_key(:if, updates)     if updates.has_key?(:if)
end

#merge(orig, opposite, *updates) ⇒ Object



90
91
92
93
# File 'lib/rspec/core/filter_manager.rb', line 90

def merge(orig, opposite, *updates)
  _warn_deprecated_keys(updates.last)
  super
end

#reverse_merge(orig, opposite, *updates) ⇒ Object



95
96
97
98
# File 'lib/rspec/core/filter_manager.rb', line 95

def reverse_merge(orig, opposite, *updates)
  _warn_deprecated_keys(updates.last)
  super
end