class RSpec::Core::InclusionRules

@private

Constants

STANDALONE_FILTERS

Public Instance Methods

add(*args) click to toggle source
Calls superclass method RSpec::Core::FilterRules#add
# File lib/rspec/core/filter_manager.rb, line 207
def add(*args)
  set_standalone_filter(*args) || super
end
add_location(locations) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 203
def add_location(locations)
  replace_filters({ :locations => locations })
end
add_with_low_priority(*args) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 211
def add_with_low_priority(*args)
  set_standalone_filter(*args) || super
end
include_example?(example) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 219
def include_example?(example)
  @rules.empty? ? true : example.any_apply?(@rules)
end
standalone?() click to toggle source
# File lib/rspec/core/filter_manager.rb, line 223
def standalone?
  is_standalone_filter?(@rules)
end
use(*args) click to toggle source
Calls superclass method
# File lib/rspec/core/filter_manager.rb, line 215
def use(*args)
  set_standalone_filter(*args) || super
end

Private Instance Methods

is_standalone_filter?(rules) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 243
def is_standalone_filter?(rules)
  STANDALONE_FILTERS.any? { |key| rules.has_key?(key) }
end
replace_filters(new_rules) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 238
def replace_filters(new_rules)
  @rules.replace(new_rules)
  opposite.clear
end
set_standalone_filter(updated) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 229
def set_standalone_filter(updated)
  return true if standalone?

  if is_standalone_filter?(updated)
    replace_filters(updated)
    true
  end
end