Class: SuperDiff::RSpec::OperationTreeBuilders::CollectionIncluding
- Inherits:
-
Basic::OperationTreeBuilders::Array
- Object
- Core::AbstractOperationTreeBuilder
- Basic::OperationTreeBuilders::Array
- SuperDiff::RSpec::OperationTreeBuilders::CollectionIncluding
- Defined in:
- lib/super_diff/rspec/operation_tree_builders/collection_including.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(expected:, actual:, **rest) ⇒ CollectionIncluding
constructor
A new instance of CollectionIncluding.
Methods inherited from Basic::OperationTreeBuilders::Array
Methods inherited from Core::AbstractOperationTreeBuilder
Constructor Details
#initialize(expected:, actual:, **rest) ⇒ CollectionIncluding
Returns a new instance of CollectionIncluding.
14 15 16 17 18 |
# File 'lib/super_diff/rspec/operation_tree_builders/collection_including.rb', line 14 def initialize(expected:, actual:, **rest) super @expected = actual_with_extra_items_in_expected_at_end end |
Class Method Details
.applies_to?(expected, actual) ⇒ Boolean
7 8 9 10 11 12 |
# File 'lib/super_diff/rspec/operation_tree_builders/collection_including.rb', line 7 def self.applies_to?(expected, actual) ( SuperDiff::RSpec.a_collection_including_something?(expected) || SuperDiff::RSpec.array_including_something?(expected) ) && actual.is_a?(::Array) end |