123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::InclusionRules Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, FilterRules
Instance Chain:
self, FilterRules
Inherits: RSpec::Core::FilterRules
Defined in: rspec-core/lib/rspec/core/filter_manager.rb

Constant Summary

FilterRules - Inherited

PROC_HEX_NUMBER, PROJECT_DIR

Class Method Summary

FilterRules - Inherited

Instance Attribute Summary

FilterRules - Inherited

Instance Method Summary

Instance Attribute Details

#standalone?Boolean (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/filter_manager.rb', line 199

def standalone?
  is_standalone_filter?(@rules)
end

Instance Method Details

#add(*args)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/filter_manager.rb', line 187

def add(*args)
  apply_standalone_filter(*args) || super
end

#add_with_low_priority(*args)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/filter_manager.rb', line 191

def add_with_low_priority(*args)
  apply_standalone_filter(*args) || super
end

#apply_standalone_filter(updated) (private)

[ GitHub ]

  
# File 'rspec-core/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

#include_example?(example) ⇒ Boolean

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/filter_manager.rb', line 195

def include_example?(example)
  @rules.empty? || super
end

#is_standalone_filter?(rules) ⇒ Boolean (private)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/filter_manager.rb', line 226

def is_standalone_filter?(rules)
  rules.key?(:full_description)
end

#replace_filters(new_rules) (private)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/filter_manager.rb', line 221

def replace_filters(new_rules)
  @rules.replace(new_rules)
  opposite.clear
end

#split_file_scoped_rules

[ GitHub ]

  
# File 'rspec-core/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