Skip to content

Commit 5aa0256

Browse files
committed
Change more :if / :unless to :skip
1 parent 2208bf5 commit 5aa0256

32 files changed

+70
-70
lines changed

rspec-expectations/spec/rspec/expectations/block_snippet_extractor_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'rspec/expectations/block_snippet_extractor'
22

33
module RSpec::Expectations
4-
RSpec.describe BlockSnippetExtractor, :if => RSpec::Support::RubyFeatures.ripper_supported? do
4+
RSpec.describe BlockSnippetExtractor, :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
55
subject(:extractor) do
66
BlockSnippetExtractor.new(proc_object, 'target_method')
77
end

rspec-expectations/spec/rspec/expectations/configuration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class << rspec_dup; undef configuration; end
4444
end
4545
end
4646

47-
context 'on an interpreter that does not provide BasicObject', :uses_should, :unless => defined?(::BasicObject) do
47+
context 'on an interpreter that does not provide BasicObject', :uses_should, :skip => defined?(::BasicObject) do
4848
def with_delegate
4949
in_sub_process_if_possible do
5050
require 'delegate'

rspec-expectations/spec/rspec/expectations/extensions/kernel_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}.to fail_with("the failure message")
2020
end
2121

22-
context "on interpreters that have BasicObject", :if => defined?(BasicObject) do
22+
context "on interpreters that have BasicObject", :skip => !defined?(BasicObject) do
2323
let(:proxy_class) do
2424
Class.new(BasicObject) do
2525
def initialize(target)

rspec-expectations/spec/rspec/expectations/syntax_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module Expectations
8686
end
8787

8888
RSpec.describe Expectations do
89-
it "does not inadvertently define BasicObject on 1.8", :if => RUBY_VERSION.to_f < 1.9 do
89+
it "does not inadvertently define BasicObject on 1.8", :skip => RUBY_VERSION.to_f > 1.8 do
9090
expect(defined?(::BasicObject)).to be nil
9191
end
9292
end

rspec-expectations/spec/rspec/matchers/aliased_matcher_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def description
4949
include_examples "making a copy", :dup
5050
include_examples "making a copy", :clone
5151

52-
it 'can get a method object for delegated methods', :if => (RUBY_VERSION.to_f > 1.8) do
52+
it 'can get a method object for delegated methods', :skip => (RUBY_VERSION.to_f < 1.9) do
5353
matcher = my_base_matcher
5454
decorated = AliasedMatcher.new(matcher, Proc.new {})
5555

rspec-expectations/spec/rspec/matchers/built_in/be_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def to_return
142142
expect(object).to be_predicate(hash_a_like.new)
143143
end
144144

145-
it 'handles keyword arguments to the predicate', :if => RSpec::Support::RubyFeatures.required_kw_args_supported? do
145+
it 'handles keyword arguments to the predicate', :skip => !RSpec::Support::RubyFeatures.required_kw_args_supported? do
146146
object = Object.new
147147
binding.eval(<<-CODE, __FILE__, __LINE__)
148148
def object.predicate?(returns:); returns; end

rspec-expectations/spec/rspec/matchers/built_in/change_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def self.to_s
380380
end.to raise_error(SyntaxError, /Block not received by the `change` matcher/)
381381
end
382382

383-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
383+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
384384
context 'when the block body fits into a single line' do
385385
it "provides a #description with the block snippet" do
386386
expect(change { @instance.some_value }.description).to eq "change `@instance.some_value`"
@@ -414,7 +414,7 @@ def @instance.reload
414414
end
415415
end
416416

417-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
417+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
418418
it "provides a #description without the block snippet" do
419419
expect(change { @instance.some_value }.description).to eq "change result"
420420
end
@@ -602,13 +602,13 @@ def regexp_inspect(object)
602602
end.to fail_with(/expected #{value_pattern} to have changed by 1, but was changed by -1/)
603603
end
604604

605-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
605+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
606606
it "provides a #description with the block snippet" do
607607
expect(change { @instance.some_value }.by(3).description).to eq "change `@instance.some_value` by 3"
608608
end
609609
end
610610

611-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
611+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
612612
it "provides a #description without the block snippet" do
613613
expect(change { @instance.some_value }.by(3).description).to eq "change result by 3"
614614
end
@@ -660,13 +660,13 @@ def regexp_inspect(object)
660660
end.to fail_with(/expected #{value_pattern} to have changed by at least 2, but was changed by 1/)
661661
end
662662

663-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
663+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
664664
it "provides a #description with the block snippet" do
665665
expect(change { @instance.some_value }.by_at_least(3).description).to eq "change `@instance.some_value` by at least 3"
666666
end
667667
end
668668

669-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
669+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
670670
it "provides a #description without the block snippet" do
671671
expect(change { @instance.some_value }.by_at_least(3).description).to eq "change result by at least 3"
672672
end
@@ -718,13 +718,13 @@ def regexp_inspect(object)
718718
end.to fail_with(/expected #{value_pattern} to have changed by at most 1, but was changed by 2/)
719719
end
720720

721-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
721+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
722722
it "provides a #description with the block snippet" do
723723
expect(change { @instance.some_value }.by_at_most(3).description).to eq "change `@instance.some_value` by at most 3"
724724
end
725725
end
726726

727-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
727+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
728728
it "provides a #description without the block snippet" do
729729
expect(change { @instance.some_value }.by_at_most(3).description).to eq "change result by at most 3"
730730
end
@@ -793,13 +793,13 @@ def regexp_inspect(object)
793793
end.to fail_with(/expected #{value_pattern} to have changed from "string", but did not change/)
794794
end
795795

796-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
796+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
797797
it "provides a #description with the block snippet" do
798798
expect(change { @instance.some_value }.from(3).description).to eq "change `@instance.some_value` from 3"
799799
end
800800
end
801801

802-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
802+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
803803
it "provides a #description without the block snippet" do
804804
expect(change { @instance.some_value }.from(3).description).to eq "change result from 3"
805805
end

rspec-expectations/spec/rspec/matchers/built_in/include_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ class PseudoHash < SimpleDelegator
754754
expect({ :key => 'value', :other => 'different' }).to include(:key => 'value')
755755
end
756756

757-
it "passes if target includes the key/value pair fuzzily matched among others", :if => (RUBY_VERSION.to_f > 1.8) do
757+
it "passes if target includes the key/value pair fuzzily matched among others", :skip => (RUBY_VERSION.to_f < 1.9) do
758758
hsh = { :key => 'value', :other => 'different' }
759759

760760
expect(hsh).to include(match(/KEY/i) => 'value')
@@ -1019,7 +1019,7 @@ def matches?(_)
10191019
end
10201020

10211021
describe "expect(hash).to include(key_matcher)" do
1022-
it "passes when the matcher matches a key", :if => (RUBY_VERSION.to_f > 1.8) do
1022+
it "passes when the matcher matches a key", :skip => (RUBY_VERSION.to_f < 1.9) do
10231023
expect(:drink => "water", :food => "bread").to include(match(/foo/))
10241024
end
10251025

@@ -1028,27 +1028,27 @@ def matches?(_)
10281028
expect(description).to eq("include (match /foo/)")
10291029
end
10301030

1031-
it 'fails with a clear message when the matcher does not match', :if => (RUBY_VERSION.to_f > 1.8) do
1031+
it 'fails with a clear message when the matcher does not match', :skip => (RUBY_VERSION.to_f < 1.9) do
10321032
expect {
10331033
expect(:drink => "water", :food => "bread").to include(match(/bar/))
10341034
}.to fail_matching("expected #{hash_inspect({ :drink => "water", :food => "bread" })} to include (match /bar/)")
10351035
end
10361036
end
10371037

10381038
describe "expect(hash).to include(key_matcher => value)" do
1039-
it "passes when the matcher matches a pair", :if => (RUBY_VERSION.to_f > 1.8) do
1039+
it "passes when the matcher matches a pair", :skip => (RUBY_VERSION.to_f < 1.9) do
10401040
expect(:drink => "water", :food => "bread").to include(match(/foo/) => "bread")
10411041
end
10421042

1043-
it "passes when the matcher matches all pairs", :if => (RUBY_VERSION.to_f > 1.8) do
1043+
it "passes when the matcher matches all pairs", :skip => (RUBY_VERSION.to_f < 1.9) do
10441044
expect(:drink => "water", :food => "bread").to include(match(/foo/) => "bread", match(/ink/) => "water")
10451045
end
10461046

1047-
it "passes with a natural matcher", :if => (RUBY_VERSION.to_f > 1.8) do
1047+
it "passes with a natural matcher", :skip => (RUBY_VERSION.to_f < 1.9) do
10481048
expect(:drink => "water", :food => "bread").to include(/foo/ => "bread")
10491049
end
10501050

1051-
it "passes with a natural matcher", :if => (RUBY_VERSION.to_f > 1.8) do
1051+
it "passes with a natural matcher", :skip => (RUBY_VERSION.to_f < 1.9) do
10521052
expect(:drink => "water", :food => "bread").to include(/foo/ => /read/)
10531053
end
10541054

@@ -1057,19 +1057,19 @@ def matches?(_)
10571057
expect(description).to eq('include {(match /foo/) => "bread"}')
10581058
end
10591059

1060-
it 'fails with a clear message when the value does not match', :if => (RUBY_VERSION.to_f > 1.8) do
1060+
it 'fails with a clear message when the value does not match', :skip => (RUBY_VERSION.to_f < 1.9) do
10611061
expect {
10621062
expect(:drink => "water", :food => "bread").to include(match(/foo/) => "meat")
10631063
}.to fail_matching("expected #{hash_inspect({ :drink => "water", :food => "bread" })} to include {(match /foo/) => \"meat\"}")
10641064
end
10651065

1066-
it 'fails with a clear message when the matcher does not match', :if => (RUBY_VERSION.to_f > 1.8) do
1066+
it 'fails with a clear message when the matcher does not match', :skip => (RUBY_VERSION.to_f < 1.9) do
10671067
expect {
10681068
expect(:drink => "water", :food => "bread").to include(match(/bar/) => "bread")
10691069
}.to fail_matching("expected #{hash_inspect({ :drink => "water", :food => "bread" })} to include {(match /bar/) => \"bread\"}")
10701070
end
10711071

1072-
it 'fails with a clear message when several matchers do not match', :if => (RUBY_VERSION.to_f > 1.8) do
1072+
it 'fails with a clear message when several matchers do not match', :skip => (RUBY_VERSION.to_f < 1.9) do
10731073
expect {
10741074
expect(:drink => "water", :food => "bread").to include(match(/bar/) => "bread", match(/baz/) => "water")
10751075
}.to fail_matching("expected #{hash_inspect({ :drink => "water", :food => "bread" })} to include {(match /bar/) => \"bread\", (match /baz/) => \"water\"}")

rspec-expectations/spec/rspec/matchers/built_in/operators_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def method_missing(name, *args, &block)
4747
end
4848
end
4949

50-
describe "unsupported operators", :if => RUBY_VERSION.to_f == 1.9 do
50+
describe "unsupported operators", :skip => RUBY_VERSION.to_f < 1.9 do
5151
it "raises an appropriate error for should != expected" do
5252
expect {
5353
"apple".should != "pear"

rspec-expectations/spec/rspec/matchers/built_in/satisfy_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
end
1616

1717
context "when no custom description is provided" do
18-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
18+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
1919
it "fails with block snippet if block returns false" do
2020
expect {
2121
expect(false).to satisfy { |val| val }
@@ -39,7 +39,7 @@
3939
end
4040
end
4141

42-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
42+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
4343
it "fails without block snippet if block returns false" do
4444
expect {
4545
expect(false).to satisfy { |val| val }
@@ -88,15 +88,15 @@
8888
end
8989

9090
context "when no custom description is provided" do
91-
context 'in Ripper supported environment', :if => RSpec::Support::RubyFeatures.ripper_supported? do
91+
context 'in Ripper supported environment', :skip => !RSpec::Support::RubyFeatures.ripper_supported? do
9292
it "fails with block snippet if block returns true" do
9393
expect {
9494
expect(true).not_to satisfy { |val| val }
9595
}.to fail_with("expected true not to satisfy expression `val`")
9696
end
9797
end
9898

99-
context 'in Ripper unsupported environment', :unless => RSpec::Support::RubyFeatures.ripper_supported? do
99+
context 'in Ripper unsupported environment', :skip => RSpec::Support::RubyFeatures.ripper_supported? do
100100
it "fails without block snippet if block returns true" do
101101
expect {
102102
expect(true).not_to satisfy { |val| val }

0 commit comments

Comments
 (0)