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

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) _warn_deprecated_key(key, updates)

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

137
138
139
140
# File 'lib/rspec/core/filter_manager.rb', line 137
def _warn_deprecated_key(key, updates)
  RSpec.deprecate("FilterManager#exclude(#{key.inspect} => #{updates[key].inspect})")
  @exclusions[key] = updates.delete(key)
end

- (Object) _warn_deprecated_keys(updates)

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

130
131
132
133
# File 'lib/rspec/core/filter_manager.rb', line 130
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

- (Object) merge(orig, opposite, *updates)

118
119
120
121
# File 'lib/rspec/core/filter_manager.rb', line 118
def merge(orig, opposite, *updates)
  _warn_deprecated_keys(updates.last)
  super
end

- (Object) reverse_merge(orig, opposite, *updates)

123
124
125
126
# File 'lib/rspec/core/filter_manager.rb', line 123
def reverse_merge(orig, opposite, *updates)
  _warn_deprecated_keys(updates.last)
  super
end