From e04dd00c31ea894783bab49f288e63908823654d Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 18 Oct 2020 02:28:06 +0000 Subject: [PATCH] Change to 3.0 compatible syntax --- README.md | 3 ++- spec/spec_helper.rb | 2 +- spec/support/xspec.rb | 6 +++++- spec/unit/mutant/isolation/fork_spec.rb | 8 ++++---- spec/unit/mutant/parallel_spec.rb | 4 ++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 381f7e56d..e795c6558 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Supported indicates if a specific Ruby version / Implementation is actively supp | cRUBY/MRI | 2.5 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | cRUBY/MRI | 2.6 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | cRUBY/MRI | 2.7 | :heavy_check_mark: | :heavy_check_mark: | :soon: | :heavy_check_mark: | -| cRUBY/MRI | 3.0 | :soon: | :soon: | :soon: | :soon: | +| cRUBY/MRI | 3.0 | :warning: | :soon: | :soon: | :soon: | | jruby | TBD | :email: | :email: | :email: | :email: | | mruby | TBD | :email: | :email: | :email: | :email: | | cRUBY/MRI | < 2.5 | :no_entry: | :no_entry: | :no_entry: | :no_entry: | @@ -66,6 +66,7 @@ Supported indicates if a specific Ruby version / Implementation is actively supp Labels: * :heavy_check_mark: Supported. +* :warning: Experimental Support. * :soon: Active work in progress. * :email: Planned, please contact me on interest. * :no_entry: Not being planned, or considered, still contact me on interest. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0f91a838d..6987de613 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -49,7 +49,7 @@ def parse_expression(string) module XSpecHelper def verify_events(&block) expectations = raw_expectations - .map(&XSpec::MessageExpectation.method(:parse)) + .map { |attributes| XSpec::MessageExpectation.parse(**attributes) } XSpec::ExpectationVerifier.verify(self, expectations, &block) end diff --git a/spec/support/xspec.rb b/spec/support/xspec.rb index 800cfd4ce..5ba6c5cbd 100644 --- a/spec/support/xspec.rb +++ b/spec/support/xspec.rb @@ -53,7 +53,11 @@ def validate_block_arity(observation, yields) # block allows anything we can skip the check return if observed.equal?(-1) - fail 'Optargs currently not supported' if observed < -1 + + if observed.negative? + observed = observed.succ.abs + end + block_arity_mismatch(observation, expected, observed) unless expected.equal?(observed) end diff --git a/spec/unit/mutant/isolation/fork_spec.rb b/spec/unit/mutant/isolation/fork_spec.rb index 84e5d8255..f00578a73 100644 --- a/spec/unit/mutant/isolation/fork_spec.rb +++ b/spec/unit/mutant/isolation/fork_spec.rb @@ -206,7 +206,7 @@ def apply *read_fragments, load_success, child_wait - ].map(&XSpec::MessageExpectation.method(:parse)) + ].map { |attributes| XSpec::MessageExpectation.parse(**attributes) } end specify do @@ -235,7 +235,7 @@ def apply } }, child_wait - ].map(&XSpec::MessageExpectation.method(:parse)) + ].map { |attributes| XSpec::MessageExpectation.parse(**attributes) } end specify do @@ -258,7 +258,7 @@ def apply return: nil } } - ].map(&XSpec::MessageExpectation.method(:parse)) + ].map { |attributes| XSpec::MessageExpectation.parse(**attributes) } end specify do @@ -296,7 +296,7 @@ def apply return: [pid, status_error] } } - ].map(&XSpec::MessageExpectation.method(:parse)) + ].map { |attributes| XSpec::MessageExpectation.parse(**attributes) } end specify do diff --git a/spec/unit/mutant/parallel_spec.rb b/spec/unit/mutant/parallel_spec.rb index 14b402ecf..fed94b813 100644 --- a/spec/unit/mutant/parallel_spec.rb +++ b/spec/unit/mutant/parallel_spec.rb @@ -62,8 +62,8 @@ def ivar(value, **attributes) } end - def mvar(*arguments) - ivar(*arguments).merge(receiver: Variable::MVar) + def mvar(value, **arguments) + ivar(value, **arguments).merge(receiver: Variable::MVar) end let(:raw_expectations) do