Class: SuperDiff::RSpec::OperationTreeBuilders::CollectionIncluding
- Inherits:
-
OperationTreeBuilders::Array
- Object
- OperationTreeBuilders::Base
- 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 OperationTreeBuilders::Array
Methods inherited from OperationTreeBuilders::Base
Constructor Details
#initialize(expected:, actual:, **rest) ⇒ CollectionIncluding
Returns a new instance of CollectionIncluding.
12 13 14 15 16 |
# File 'lib/super_diff/rspec/operation_tree_builders/collection_including.rb', line 12 def initialize(expected:, actual:, **rest) super @expected = actual_with_extra_items_in_expected_at_end end |
Class Method Details
.applies_to?(expected, actual) ⇒ Boolean
5 6 7 8 9 10 |
# File 'lib/super_diff/rspec/operation_tree_builders/collection_including.rb', line 5 def self.applies_to?(expected, actual) ( SuperDiff::RSpec.a_collection_including_something?(expected) || SuperDiff::RSpec.array_including_something?(expected) ) && actual.is_a?(::Array) end |