From c88ee29201765fa5e35a51252b5f09e0674f31d6 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Mon, 10 Feb 2020 12:27:27 +0200 Subject: [PATCH 1/2] Prepare for Ruby 2.7 --- lib/super_diff/rspec/augmented_matcher.rb | 2 +- lib/super_diff/rspec/matcher_text_builders/match.rb | 2 +- lib/super_diff/rspec/matcher_text_builders/respond_to.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/super_diff/rspec/augmented_matcher.rb b/lib/super_diff/rspec/augmented_matcher.rb index ff0b943d..6957d280 100644 --- a/lib/super_diff/rspec/augmented_matcher.rb +++ b/lib/super_diff/rspec/augmented_matcher.rb @@ -31,7 +31,7 @@ def build_failure_message(negated:) def matcher_text_builder @_matcher_text_builder ||= - matcher_text_builder_class.new(matcher_text_builder_args) + matcher_text_builder_class.new(**matcher_text_builder_args) end def matcher_text_builder_class diff --git a/lib/super_diff/rspec/matcher_text_builders/match.rb b/lib/super_diff/rspec/matcher_text_builders/match.rb index 6c6ef8ce..7c8b8aae 100644 --- a/lib/super_diff/rspec/matcher_text_builders/match.rb +++ b/lib/super_diff/rspec/matcher_text_builders/match.rb @@ -3,7 +3,7 @@ module RSpec module MatcherTextBuilders class Match < Base def initialize(expected_captures:, **rest) - super(rest) + super(**rest) @expected_captures = expected_captures end diff --git a/lib/super_diff/rspec/matcher_text_builders/respond_to.rb b/lib/super_diff/rspec/matcher_text_builders/respond_to.rb index eb62a724..0dac37fd 100644 --- a/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +++ b/lib/super_diff/rspec/matcher_text_builders/respond_to.rb @@ -9,7 +9,7 @@ def initialize( unlimited_arguments:, **rest ) - super(rest) + super(**rest) @expected_arity = expected_arity @arbitrary_keywords = arbitrary_keywords @expected_keywords = expected_keywords From 0b7374f031a30aa555bffdc75672985ec5e31e75 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Mon, 24 Feb 2020 20:25:44 +0200 Subject: [PATCH 2/2] Get rid of "instance variable not initialized" warnings --- lib/super_diff/operational_sequencers/hash.rb | 1 - .../operational_sequencers/collection_containing_exactly.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/super_diff/operational_sequencers/hash.rb b/lib/super_diff/operational_sequencers/hash.rb index e017cf6a..b609a58f 100644 --- a/lib/super_diff/operational_sequencers/hash.rb +++ b/lib/super_diff/operational_sequencers/hash.rb @@ -108,7 +108,6 @@ def unary_operations_using_variant_of_patience_algorithm start_index.upto(eks.size - 1) do |ei2| ek = eks[ei2] ev, av2 = expected[ek], actual[ek] - ai2 = aks.index(ek) if actual.include?(ek) && ev == av2 # If the key in 'expected' we've landed on happens to be a diff --git a/lib/super_diff/rspec/operational_sequencers/collection_containing_exactly.rb b/lib/super_diff/rspec/operational_sequencers/collection_containing_exactly.rb index 58e1f097..55a86208 100644 --- a/lib/super_diff/rspec/operational_sequencers/collection_containing_exactly.rb +++ b/lib/super_diff/rspec/operational_sequencers/collection_containing_exactly.rb @@ -7,7 +7,7 @@ def self.applies_to?(expected, actual) actual.is_a?(::Array) end - def initialize(actual:, **rest) + def initialize(actual:, **) super populate_pairings_maximizer_in_expected_with(actual) end