Class: SuperDiff::RSpec::OperationTreeBuilders::CollectionContainingExactly

Inherits:
Core::AbstractOperationTreeBuilder show all
Defined in:
lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Core::AbstractOperationTreeBuilder

#call

Constructor Details

#initialize(actual:) ⇒ CollectionContainingExactly

Returns a new instance of CollectionContainingExactly.



13
14
15
16
# File 'lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb', line 13

def initialize(actual:, **)
  super
  populate_pairings_maximizer_in_expected_with(actual)
end

Class Method Details

.applies_to?(expected, actual) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb', line 7

def self.applies_to?(expected, actual)
  SuperDiff::RSpec.a_collection_containing_exactly_something?(
    expected
  ) && actual.is_a?(::Array)
end