From c4f23a166247823054da76fcf512847c1c56de43 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Tue, 16 Feb 2021 23:50:06 +0300 Subject: [PATCH] Use :skip instead of :if/:unless --- spec/rspec/mocks/matchers/receive_spec.rb | 4 ++-- spec/rspec/mocks/mutate_const_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/rspec/mocks/matchers/receive_spec.rb b/spec/rspec/mocks/matchers/receive_spec.rb index 8b2dfdb44..be2f3c5d2 100644 --- a/spec/rspec/mocks/matchers/receive_spec.rb +++ b/spec/rspec/mocks/matchers/receive_spec.rb @@ -54,13 +54,13 @@ module Mocks expect(receiver.foo).to eq(:curly) end - it 'does not support other matchers', :unless => options.include?(:allow_other_matchers) do + it 'does not support other matchers', :skip => options.include?(:allow_other_matchers) do expect { wrapped.to eq(3) }.to raise_error(UnsupportedMatcherError) end - it 'does support inherited matchers', :unless => options.include?(:allow_other_matchers) do + it 'does support inherited matchers', :skip => options.include?(:allow_other_matchers) do receive_foo = Class.new(RSpec::Mocks::Matchers::Receive).new(:foo, nil) wrapped.to receive_foo receiver.foo diff --git a/spec/rspec/mocks/mutate_const_spec.rb b/spec/rspec/mocks/mutate_const_spec.rb index 9d80dd736..12edead14 100644 --- a/spec/rspec/mocks/mutate_const_spec.rb +++ b/spec/rspec/mocks/mutate_const_spec.rb @@ -170,7 +170,7 @@ def change_const_value_to(value) expect(::Hash).to equal(top_level_hash) end - it 'does not affect the ability to access the top-level constant from nested contexts', :silence_warnings, :if => RUBY_VERSION < '2.5' do + it 'does not affect the ability to access the top-level constant from nested contexts', :silence_warnings, :skip => RUBY_VERSION >= '2.5' do top_level_hash = ::Hash hide_const("TestClass::Hash")