Class: RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Struct
|
|
Instance Chain:
self,
Struct
|
|
Inherits: |
Struct
|
Defined in: | rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb |
Instance Attribute Summary
- #candidate? ⇒ Boolean readonly Internal use only
- #ideal? ⇒ Boolean readonly Internal use only
- #indeterminate_actual_indexes rw Internal use only
- #indeterminate_expected_indexes rw Internal use only
- #unmatched_actual_indexes rw Internal use only
- #unmatched_expected_indexes rw Internal use only
Instance Method Summary
- #+(derived_candidate_solution) Internal use only
- #unmatched_item_count Internal use only
- #worse_than?(other) ⇒ Boolean Internal use only
Instance Attribute Details
#candidate? ⇒ Boolean
(readonly)
# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 196
def candidate? indeterminate_expected_indexes.empty? && indeterminate_actual_indexes.empty? end
#ideal? ⇒ Boolean
(readonly)
# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 201
def ideal? candidate? && ( unmatched_expected_indexes.empty? || unmatched_actual_indexes.empty? ) end
#indeterminate_actual_indexes (rw)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 190
Solution = Struct.new(:unmatched_expected_indexes, :unmatched_actual_indexes, :indeterminate_expected_indexes, :indeterminate_actual_indexes)
#indeterminate_expected_indexes (rw)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 190
Solution = Struct.new(:unmatched_expected_indexes, :unmatched_actual_indexes, :indeterminate_expected_indexes, :indeterminate_actual_indexes)
#unmatched_actual_indexes (rw)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 190
Solution = Struct.new(:unmatched_expected_indexes, :unmatched_actual_indexes, :indeterminate_expected_indexes, :indeterminate_actual_indexes)
#unmatched_expected_indexes (rw)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 190
Solution = Struct.new(:unmatched_expected_indexes, :unmatched_actual_indexes, :indeterminate_expected_indexes, :indeterminate_actual_indexes)
Instance Method Details
#+(derived_candidate_solution)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 212
def +(derived_candidate_solution) self.class.new( unmatched_expected_indexes + derived_candidate_solution.unmatched_expected_indexes, unmatched_actual_indexes + derived_candidate_solution.unmatched_actual_indexes, # Ignore the indeterminate indexes: by the time we get here, # we've dealt with all indeterminates. [], [] ) end
#unmatched_item_count
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 208
def unmatched_item_count unmatched_expected_indexes.count + unmatched_actual_indexes.count end
#worse_than?(other) ⇒ Boolean
# File 'rspec-expectations/lib/rspec/matchers/built_in/contain_exactly.rb', line 192
def worse_than?(other) unmatched_item_count > other.unmatched_item_count end