class RSpec::Core::InclusionRules

@private

Public Instance Methods

add(*args) click to toggle source
Calls superclass method RSpec::Core::FilterRules#add
# File lib/rspec/core/filter_manager.rb, line 187
def add(*args)
  apply_standalone_filter(*args) || super
end
add_with_low_priority(*args) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 191
def add_with_low_priority(*args)
  apply_standalone_filter(*args) || super
end
include_example?(example) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 195
def include_example?(example)
  @rules.empty? || super
end
split_file_scoped_rules() click to toggle source
# File lib/rspec/core/filter_manager.rb, line 203
def split_file_scoped_rules
  rules_dup = @rules.dup
  locations = rules_dup.delete(:locations) { Hash.new([]) }
  ids       = rules_dup.delete(:ids)       { Hash.new([]) }

  return locations, ids, self.class.new(rules_dup)
end
standalone?() click to toggle source
# File lib/rspec/core/filter_manager.rb, line 199
def standalone?
  is_standalone_filter?(@rules)
end

Private Instance Methods

apply_standalone_filter(updated) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 213
def apply_standalone_filter(updated)
  return true if standalone?
  return nil unless is_standalone_filter?(updated)

  replace_filters(updated)
  true
end
is_standalone_filter?(rules) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 226
def is_standalone_filter?(rules)
  rules.key?(:full_description)
end
replace_filters(new_rules) click to toggle source
# File lib/rspec/core/filter_manager.rb, line 221
def replace_filters(new_rules)
  @rules.replace(new_rules)
  opposite.clear
end