Skip to content

Commit

Permalink
[mocks] Merge pull request rspec/rspec-mocks#1413 from rspec/use-skip…
Browse files Browse the repository at this point in the history
…-instead-of-if-else

Use :skip instead of :if/:unless

---
This commit was imported from rspec/rspec-mocks@38de6cd.
  • Loading branch information
pirj committed Feb 16, 2021
2 parents ae3556b + 28c05ad commit ca52c47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rspec-mocks/spec/rspec/mocks/matchers/receive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rspec-mocks/spec/rspec/mocks/mutate_const_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ca52c47

Please sign in to comment.