Class: RSpec::Core::InclusionRules

Inherits:
FilterRules show all
Defined in:
lib/rspec/core/filter_manager.rb

Constant Summary

Constants inherited from FilterRules

FilterRules::PROC_HEX_NUMBER, FilterRules::PROJECT_DIR

Instance Attribute Summary

Attributes inherited from FilterRules

#opposite, #rules

Instance Method Summary collapse

Methods inherited from FilterRules

#[], build, #clear, #delete, #description, #each_pair, #empty?, #fetch, #initialize, #use_only

Constructor Details

This class inherits a constructor from RSpec::Core::FilterRules

Instance Method Details

#add(*args) ⇒ Object



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

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

#add_with_low_priority(*args) ⇒ Object



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

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

#include_example?(example) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#split_file_scoped_rulesObject



203
204
205
206
207
208
209
# 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?Boolean

Returns:

  • (Boolean)


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

def standalone?
  is_standalone_filter?(@rules)
end