diff options
author | Benoit Daloze <[email protected]> | 2020-05-03 12:28:29 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-05-03 12:28:29 +0200 |
commit | 5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 (patch) | |
tree | e1694f5a4a5558884b1b8f3890b186793e5e982f /spec/ruby/core | |
parent | f646d20aaeb8f02bcd3d0c5c3f5a372da654502a (diff) |
Update to ruby/spec@032ee74
Diffstat (limited to 'spec/ruby/core')
166 files changed, 555 insertions, 555 deletions
diff --git a/spec/ruby/core/argf/binmode_spec.rb b/spec/ruby/core/argf/binmode_spec.rb index bdcc6aa30a..e083a30a27 100644 --- a/spec/ruby/core/argf/binmode_spec.rb +++ b/spec/ruby/core/argf/binmode_spec.rb @@ -34,7 +34,7 @@ describe "ARGF.binmode" do it "sets the file's encoding to BINARY" do argf [@bin_file, @file1] do @argf.binmode - @argf.binmode?.should == true + @argf.should.binmode? @argf.gets.encoding.should == Encoding::BINARY @argf.skip @argf.read.encoding.should == Encoding::BINARY diff --git a/spec/ruby/core/array/any_spec.rb b/spec/ruby/core/array/any_spec.rb index 2fa5353e99..09d949fe6e 100644 --- a/spec/ruby/core/array/any_spec.rb +++ b/spec/ruby/core/array/any_spec.rb @@ -4,17 +4,17 @@ describe "Array#any?" do describe 'with no block given (a default block of { |x| x } is implicit)' do it "is false if the array is empty" do empty_array = [] - empty_array.any?.should == false + empty_array.should_not.any? end it "is false if the array is not empty, but all the members of the array are falsy" do falsy_array = [false, nil, false] - falsy_array.any?.should == false + falsy_array.should_not.any? end it "is true if the array has any truthy members" do not_empty_array = ['anything', nil] - not_empty_array.any?.should == true + not_empty_array.should.any? end end diff --git a/spec/ruby/core/array/clear_spec.rb b/spec/ruby/core/array/clear_spec.rb index 5c7a934d75..bddc672d3b 100644 --- a/spec/ruby/core/array/clear_spec.rb +++ b/spec/ruby/core/array/clear_spec.rb @@ -16,7 +16,7 @@ describe "Array#clear" do it "leaves the Array empty" do a = [1] a.clear - a.empty?.should == true + a.should.empty? a.size.should == 0 end diff --git a/spec/ruby/core/array/clone_spec.rb b/spec/ruby/core/array/clone_spec.rb index 803e746e02..e22a6c6d53 100644 --- a/spec/ruby/core/array/clone_spec.rb +++ b/spec/ruby/core/array/clone_spec.rb @@ -12,8 +12,8 @@ describe "Array#clone" do aa = a.clone bb = b.clone - aa.frozen?.should == true - bb.frozen?.should == false + aa.should.frozen? + bb.should_not.frozen? end it "copies singleton methods" do diff --git a/spec/ruby/core/array/empty_spec.rb b/spec/ruby/core/array/empty_spec.rb index b5f3e8ed48..f70b1b6ebe 100644 --- a/spec/ruby/core/array/empty_spec.rb +++ b/spec/ruby/core/array/empty_spec.rb @@ -3,8 +3,8 @@ require_relative 'fixtures/classes' describe "Array#empty?" do it "returns true if the array has no elements" do - [].empty?.should == true - [1].empty?.should == false - [1, 2].empty?.should == false + [].should.empty? + [1].should_not.empty? + [1, 2].should_not.empty? end end diff --git a/spec/ruby/core/array/frozen_spec.rb b/spec/ruby/core/array/frozen_spec.rb index bb4b2b4067..3ba54be46b 100644 --- a/spec/ruby/core/array/frozen_spec.rb +++ b/spec/ruby/core/array/frozen_spec.rb @@ -4,13 +4,13 @@ require_relative 'fixtures/classes' describe "Array#frozen?" do it "returns true if array is frozen" do a = [1, 2, 3] - a.frozen?.should == false + a.should_not.frozen? a.freeze - a.frozen?.should == true + a.should.frozen? end it "returns false for an array being sorted by #sort" do a = [1, 2, 3] - a.sort { |x,y| a.frozen?.should == false; x <=> y } + a.sort { |x,y| a.should_not.frozen?; x <=> y } end end diff --git a/spec/ruby/core/array/multiply_spec.rb b/spec/ruby/core/array/multiply_spec.rb index 4060666d4b..8ccec13d42 100644 --- a/spec/ruby/core/array/multiply_spec.rb +++ b/spec/ruby/core/array/multiply_spec.rb @@ -92,39 +92,39 @@ describe "Array#* with an integer" do it "copies the taint status of the original array even if the passed count is 0" do ary = [1, 2, 3] ary.taint - (ary * 0).tainted?.should == true + (ary * 0).should.tainted? end it "copies the taint status of the original array even if the array is empty" do ary = [] ary.taint - (ary * 3).tainted?.should == true + (ary * 3).should.tainted? end it "copies the taint status of the original array if the passed count is not 0" do ary = [1, 2, 3] ary.taint - (ary * 1).tainted?.should == true - (ary * 2).tainted?.should == true + (ary * 1).should.tainted? + (ary * 2).should.tainted? end it "copies the untrusted status of the original array even if the passed count is 0" do ary = [1, 2, 3] ary.untrust - (ary * 0).untrusted?.should == true + (ary * 0).should.untrusted? end it "copies the untrusted status of the original array even if the array is empty" do ary = [] ary.untrust - (ary * 3).untrusted?.should == true + (ary * 3).should.untrusted? end it "copies the untrusted status of the original array if the passed count is not 0" do ary = [1, 2, 3] ary.untrust - (ary * 1).untrusted?.should == true - (ary * 2).untrusted?.should == true + (ary * 1).should.untrusted? + (ary * 2).should.untrusted? end end end diff --git a/spec/ruby/core/array/shared/clone.rb b/spec/ruby/core/array/shared/clone.rb index f6f581b17c..3c17b1f10f 100644 --- a/spec/ruby/core/array/shared/clone.rb +++ b/spec/ruby/core/array/shared/clone.rb @@ -26,8 +26,8 @@ describe :array_clone, shared: true do aa = a.send @method bb = b.send @method - aa.tainted?.should == true - bb.tainted?.should == false + aa.should.tainted? + bb.should_not.tainted? end it "copies untrusted status from the original" do @@ -37,8 +37,8 @@ describe :array_clone, shared: true do aa = a.send @method bb = b.send @method - aa.untrusted?.should == true - bb.untrusted?.should == false + aa.should.untrusted? + bb.should_not.untrusted? end end end diff --git a/spec/ruby/core/array/sort_spec.rb b/spec/ruby/core/array/sort_spec.rb index 541f3a5964..0c5ecdcbbf 100644 --- a/spec/ruby/core/array/sort_spec.rb +++ b/spec/ruby/core/array/sort_spec.rb @@ -58,9 +58,9 @@ describe "Array#sort" do b = ArraySpecs::MockForCompared.new c = ArraySpecs::MockForCompared.new - ArraySpecs::MockForCompared.compared?.should == false + ArraySpecs::MockForCompared.should_not.compared? [a, b, c].sort.should == [c, b, a] - ArraySpecs::MockForCompared.compared?.should == true + ArraySpecs::MockForCompared.should.compared? end it "does not deal with exceptions raised by unimplemented or incorrect #<=>" do @@ -104,7 +104,7 @@ describe "Array#sort" do it "does not freezes self during being sorted" do a = [1, 2, 3] - a.sort { |x,y| a.frozen?.should == false; x <=> y } + a.sort { |x,y| a.should_not.frozen?; x <=> y } end it "returns the specified value when it would break in the given block" do @@ -207,9 +207,9 @@ describe "Array#sort!" do b = ArraySpecs::MockForCompared.new c = ArraySpecs::MockForCompared.new - ArraySpecs::MockForCompared.compared?.should == false + ArraySpecs::MockForCompared.should_not.compared? [a, b, c].sort!.should == [c, b, a] - ArraySpecs::MockForCompared.compared?.should == true + ArraySpecs::MockForCompared.should.compared? end it "does not call #<=> on contained objects when invoked with a block" do diff --git a/spec/ruby/core/array/uniq_spec.rb b/spec/ruby/core/array/uniq_spec.rb index 38e1878f10..fd604987c1 100644 --- a/spec/ruby/core/array/uniq_spec.rb +++ b/spec/ruby/core/array/uniq_spec.rb @@ -87,8 +87,8 @@ describe "Array#uniq" do end a.uniq.should == a - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? a = Array.new(2) do obj = mock('0') @@ -106,8 +106,8 @@ describe "Array#uniq" do end a.uniq.size.should == 1 - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? end end diff --git a/spec/ruby/core/class/allocate_spec.rb b/spec/ruby/core/class/allocate_spec.rb index c426c38ff9..b39622e06a 100644 --- a/spec/ruby/core/class/allocate_spec.rb +++ b/spec/ruby/core/class/allocate_spec.rb @@ -30,7 +30,7 @@ describe "Class#allocate" do end end - klass.allocate.initialized?.should == false + klass.allocate.should_not.initialized? end it "raises TypeError for #superclass" do diff --git a/spec/ruby/core/class/new_spec.rb b/spec/ruby/core/class/new_spec.rb index 8191ce6a37..989d674558 100644 --- a/spec/ruby/core/class/new_spec.rb +++ b/spec/ruby/core/class/new_spec.rb @@ -126,7 +126,7 @@ describe "Class#new" do end end - klass.new.initialized?.should == true + klass.new.should.initialized? klass.new(1, 2, 3).args.should == [1, 2, 3] end diff --git a/spec/ruby/core/complex/finite_spec.rb b/spec/ruby/core/complex/finite_spec.rb index 718848390c..7d9f82404e 100644 --- a/spec/ruby/core/complex/finite_spec.rb +++ b/spec/ruby/core/complex/finite_spec.rb @@ -2,31 +2,31 @@ require_relative '../../spec_helper' describe "Complex#finite?" do it "returns true if magnitude is finite" do - (1+1i).finite?.should == true + (1+1i).should.finite? end it "returns false for positive infinity" do value = Complex(Float::INFINITY, 42) - value.finite?.should == false + value.should_not.finite? end it "returns false for positive complex with infinite imaginary" do value = Complex(1, Float::INFINITY) - value.finite?.should == false + value.should_not.finite? end it "returns false for negative infinity" do value = -Complex(Float::INFINITY, 42) - value.finite?.should == false + value.should_not.finite? end it "returns false for negative complex with infinite imaginary" do value = -Complex(1, Float::INFINITY) - value.finite?.should == false + value.should_not.finite? end it "returns false for NaN" do value = Complex(Float::NAN, Float::NAN) - value.finite?.should == false + value.should_not.finite? end end diff --git a/spec/ruby/core/dir/glob_spec.rb b/spec/ruby/core/dir/glob_spec.rb index 4b437b0e24..d4888ee147 100644 --- a/spec/ruby/core/dir/glob_spec.rb +++ b/spec/ruby/core/dir/glob_spec.rb @@ -119,7 +119,7 @@ describe "Dir.glob" do end it "handles infinite directory wildcards" do - Dir.glob('**/**/**').empty?.should == false + Dir.glob('**/**/**').should_not.empty? end it "handles simple filename patterns" do diff --git a/spec/ruby/core/dir/home_spec.rb b/spec/ruby/core/dir/home_spec.rb index 73deca2cfd..713ba9db9a 100644 --- a/spec/ruby/core/dir/home_spec.rb +++ b/spec/ruby/core/dir/home_spec.rb @@ -17,7 +17,7 @@ describe "Dir.home" do end it "returns a non-frozen string" do - Dir.home.frozen?.should == false + Dir.home.should_not.frozen? end end @@ -35,7 +35,7 @@ describe "Dir.home" do end it "returns a non-frozen string" do - Dir.home(ENV['USER']).frozen?.should == false + Dir.home(ENV['USER']).should_not.frozen? end end diff --git a/spec/ruby/core/dir/shared/open.rb b/spec/ruby/core/dir/shared/open.rb index 76b08dc288..920845cba1 100644 --- a/spec/ruby/core/dir/shared/open.rb +++ b/spec/ruby/core/dir/shared/open.rb @@ -66,7 +66,7 @@ describe :dir_open, shared: true do Dir.send(@method, DirSpecs.mock_dir) do |dir| io = IO.for_fd(dir.fileno) io.autoclose = false - io.close_on_exec?.should == true + io.should.close_on_exec? end end end diff --git a/spec/ruby/core/enumerable/all_spec.rb b/spec/ruby/core/enumerable/all_spec.rb index ae255c662c..7e9726fe87 100644 --- a/spec/ruby/core/enumerable/all_spec.rb +++ b/spec/ruby/core/enumerable/all_spec.rb @@ -10,13 +10,13 @@ describe "Enumerable#all?" do end it "always returns true on empty enumeration" do - @empty.all?.should == true + @empty.should.all? @empty.all? { nil }.should == true - [].all?.should == true + [].should.all? [].all? { false }.should == true - {}.all?.should == true + {}.should.all? {}.all? { nil }.should == true end @@ -38,24 +38,24 @@ describe "Enumerable#all?" do describe "with no block" do it "returns true if no elements are false or nil" do - @enum.all?.should == true - @enum1.all?.should == true - @enum2.all?.should == false + @enum.should.all? + @enum1.should.all? + @enum2.should_not.all? - EnumerableSpecs::Numerous.new('a','b','c').all?.should == true - EnumerableSpecs::Numerous.new(0, "x", true).all?.should == true + EnumerableSpecs::Numerous.new('a','b','c').should.all? + EnumerableSpecs::Numerous.new(0, "x", true).should.all? end it "returns false if there are false or nil elements" do - EnumerableSpecs::Numerous.new(false).all?.should == false - EnumerableSpecs::Numerous.new(false, false).all?.should == false + EnumerableSpecs::Numerous.new(false).should_not.all? + EnumerableSpecs::Numerous.new(false, false).should_not.all? - EnumerableSpecs::Numerous.new(nil).all?.should == false - EnumerableSpecs::Numerous.new(nil, nil).all?.should == false + EnumerableSpecs::Numerous.new(nil).should_not.all? + EnumerableSpecs::Numerous.new(nil, nil).should_not.all? - EnumerableSpecs::Numerous.new(1, nil, 2).all?.should == false - EnumerableSpecs::Numerous.new(0, "x", false, true).all?.should == false - @enum2.all?.should == false + EnumerableSpecs::Numerous.new(1, nil, 2).should_not.all? + EnumerableSpecs::Numerous.new(0, "x", false, true).should_not.all? + @enum2.should_not.all? end it "gathers whole arrays as elements when each yields multiple" do diff --git a/spec/ruby/core/enumerable/any_spec.rb b/spec/ruby/core/enumerable/any_spec.rb index 0202506d10..64e3159963 100644 --- a/spec/ruby/core/enumerable/any_spec.rb +++ b/spec/ruby/core/enumerable/any_spec.rb @@ -10,13 +10,13 @@ describe "Enumerable#any?" do end it "always returns false on empty enumeration" do - @empty.any?.should == false + @empty.should_not.any? @empty.any? { nil }.should == false - [].any?.should == false + [].should_not.any? [].any? { false }.should == false - {}.any?.should == false + {}.should_not.any? {}.any? { nil }.should == false end @@ -38,24 +38,24 @@ describe "Enumerable#any?" do describe "with no block" do it "returns true if any element is not false or nil" do - @enum.any?.should == true - @enum1.any?.should == true - @enum2.any?.should == true - EnumerableSpecs::Numerous.new(true).any?.should == true - EnumerableSpecs::Numerous.new('a','b','c').any?.should == true - EnumerableSpecs::Numerous.new('a','b','c', nil).any?.should == true - EnumerableSpecs::Numerous.new(1, nil, 2).any?.should == true - EnumerableSpecs::Numerous.new(1, false).any?.should == true - EnumerableSpecs::Numerous.new(false, nil, 1, false).any?.should == true - EnumerableSpecs::Numerous.new(false, 0, nil).any?.should == true + @enum.should.any? + @enum1.should.any? + @enum2.should.any? + EnumerableSpecs::Numerous.new(true).should.any? + EnumerableSpecs::Numerous.new('a','b','c').should.any? + EnumerableSpecs::Numerous.new('a','b','c', nil).should.any? + EnumerableSpecs::Numerous.new(1, nil, 2).should.any? + EnumerableSpecs::Numerous.new(1, false).should.any? + EnumerableSpecs::Numerous.new(false, nil, 1, false).should.any? + EnumerableSpecs::Numerous.new(false, 0, nil).should.any? end it "returns false if all elements are false or nil" do - EnumerableSpecs::Numerous.new(false).any?.should == false - EnumerableSpecs::Numerous.new(false, false).any?.should == false - EnumerableSpecs::Numerous.new(nil).any?.should == false - EnumerableSpecs::Numerous.new(nil, nil).any?.should == false - EnumerableSpecs::Numerous.new(nil, false, nil).any?.should == false + EnumerableSpecs::Numerous.new(false).should_not.any? + EnumerableSpecs::Numerous.new(false, false).should_not.any? + EnumerableSpecs::Numerous.new(nil).should_not.any? + EnumerableSpecs::Numerous.new(nil, nil).should_not.any? + EnumerableSpecs::Numerous.new(nil, false, nil).should_not.any? end it "gathers whole arrays as elements when each yields multiple" do diff --git a/spec/ruby/core/enumerable/none_spec.rb b/spec/ruby/core/enumerable/none_spec.rb index 8c886736ab..ec48eaf0a7 100644 --- a/spec/ruby/core/enumerable/none_spec.rb +++ b/spec/ruby/core/enumerable/none_spec.rb @@ -10,7 +10,7 @@ describe "Enumerable#none?" do end it "always returns true on empty enumeration" do - @empty.none?.should == true + @empty.should.none? @empty.none? { true }.should == true end diff --git a/spec/ruby/core/enumerable/one_spec.rb b/spec/ruby/core/enumerable/one_spec.rb index 46a10d68eb..6489c84742 100644 --- a/spec/ruby/core/enumerable/one_spec.rb +++ b/spec/ruby/core/enumerable/one_spec.rb @@ -10,7 +10,7 @@ describe "Enumerable#one?" do end it "always returns false on empty enumeration" do - @empty.one?.should == false + @empty.should_not.one? @empty.one? { true }.should == false end diff --git a/spec/ruby/core/enumerable/uniq_spec.rb b/spec/ruby/core/enumerable/uniq_spec.rb index 82c041d4ef..e58dd36366 100644 --- a/spec/ruby/core/enumerable/uniq_spec.rb +++ b/spec/ruby/core/enumerable/uniq_spec.rb @@ -79,8 +79,8 @@ describe 'Enumerable#uniq' do end a.uniq.should == a - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? a = Array.new(2) do obj = mock('0') @@ -98,8 +98,8 @@ describe 'Enumerable#uniq' do end a.to_enum.uniq.size.should == 1 - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? end end diff --git a/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb b/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb index 8ce0ce0cd9..5be189e993 100644 --- a/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb +++ b/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb @@ -4,15 +4,15 @@ ruby_version_is "2.6" do describe "Enumerator::ArithmeticSequence#exclude_end?" do context "when created using Numeric#step" do it "always returns false" do - 1.step(10).exclude_end?.should == false - 10.step(1).exclude_end?.should == false + 1.step(10).should_not.exclude_end? + 10.step(1).should_not.exclude_end? end end context "when created using Range#step" do it "mirrors range.exclude_end?" do - (1...10).step.exclude_end?.should == true - (1..10).step.exclude_end?.should == false + (1...10).step.should.exclude_end? + (1..10).step.should_not.exclude_end? end end end diff --git a/spec/ruby/core/env/element_reference_spec.rb b/spec/ruby/core/env/element_reference_spec.rb index 7d2a2d78e3..1cd58ace54 100644 --- a/spec/ruby/core/env/element_reference_spec.rb +++ b/spec/ruby/core/env/element_reference_spec.rb @@ -16,7 +16,7 @@ describe "ENV.[]" do it "returns only frozen values" do ENV[@variable] = "a non-frozen string" - ENV[@variable].frozen?.should == true + ENV[@variable].should.frozen? end it "coerces a non-string name with #to_str" do diff --git a/spec/ruby/core/env/empty_spec.rb b/spec/ruby/core/env/empty_spec.rb index 7ef17d244f..afeb406a9e 100644 --- a/spec/ruby/core/env/empty_spec.rb +++ b/spec/ruby/core/env/empty_spec.rb @@ -4,12 +4,12 @@ describe "ENV.empty?" do it "returns true if the Environment is empty" do if ENV.keys.size > 0 - ENV.empty?.should == false + ENV.should_not.empty? end orig = ENV.to_hash begin ENV.clear - ENV.empty?.should == true + ENV.should.empty? ensure ENV.replace orig end @@ -17,7 +17,7 @@ describe "ENV.empty?" do it "returns false if not empty" do if ENV.keys.size > 0 - ENV.empty?.should == false + ENV.should_not.empty? end end end diff --git a/spec/ruby/core/env/shift_spec.rb b/spec/ruby/core/env/shift_spec.rb index c03b5d50c5..0fe08d4f6d 100644 --- a/spec/ruby/core/env/shift_spec.rb +++ b/spec/ruby/core/env/shift_spec.rb @@ -2,7 +2,7 @@ require_relative '../../spec_helper' describe "ENV.shift" do it "returns a pair and deletes it" do - ENV.empty?.should == false + ENV.should_not.empty? orig = ENV.to_hash begin pair = ENV.shift diff --git a/spec/ruby/core/exception/success_spec.rb b/spec/ruby/core/exception/success_spec.rb index 70af9c74eb..6f21743340 100644 --- a/spec/ruby/core/exception/success_spec.rb +++ b/spec/ruby/core/exception/success_spec.rb @@ -3,13 +3,13 @@ require_relative '../../spec_helper' describe "SystemExit#success?" do it "returns true if the process exited successfully" do -> { exit 0 }.should raise_error(SystemExit) { |e| - e.success?.should == true + e.should.success? } end it "returns false if the process exited unsuccessfully" do -> { exit(-1) }.should raise_error(SystemExit) { |e| - e.success?.should == false + e.should_not.success? } end end diff --git a/spec/ruby/core/false/to_s_spec.rb b/spec/ruby/core/false/to_s_spec.rb index c996d87000..4cae278891 100644 --- a/spec/ruby/core/false/to_s_spec.rb +++ b/spec/ruby/core/false/to_s_spec.rb @@ -7,7 +7,7 @@ describe "FalseClass#to_s" do ruby_version_is "2.7" do it "returns a frozen string" do - false.to_s.frozen?.should == true + false.to_s.should.frozen? end it "always returns the same string" do diff --git a/spec/ruby/core/file/expand_path_spec.rb b/spec/ruby/core/file/expand_path_spec.rb index 88078645ab..c31f885b92 100644 --- a/spec/ruby/core/file/expand_path_spec.rb +++ b/spec/ruby/core/file/expand_path_spec.rb @@ -203,9 +203,9 @@ platform_is_not :windows do it "does not return a frozen string" do home = "/rubyspec_home" - File.expand_path('~').frozen?.should == false - File.expand_path('~', '/tmp/gumby/ddd').frozen?.should == false - File.expand_path('~/a', '/tmp/gumby/ddd').frozen?.should == false + File.expand_path('~').should_not.frozen? + File.expand_path('~', '/tmp/gumby/ddd').should_not.frozen? + File.expand_path('~/a', '/tmp/gumby/ddd').should_not.frozen? end end diff --git a/spec/ruby/core/file/lchmod_spec.rb b/spec/ruby/core/file/lchmod_spec.rb index bab362980a..4abe42526d 100644 --- a/spec/ruby/core/file/lchmod_spec.rb +++ b/spec/ruby/core/file/lchmod_spec.rb @@ -20,13 +20,13 @@ describe "File.lchmod" do File.chmod(0222, @lname).should == 1 File.lchmod(0755, @lname).should == 1 - File.lstat(@lname).executable?.should == true - File.lstat(@lname).readable?.should == true - File.lstat(@lname).writable?.should == true + File.lstat(@lname).should.executable? + File.lstat(@lname).should.readable? + File.lstat(@lname).should.writable? - File.stat(@lname).executable?.should == false - File.stat(@lname).readable?.should == false - File.stat(@lname).writable?.should == true + File.stat(@lname).should_not.executable? + File.stat(@lname).should_not.readable? + File.stat(@lname).should.writable? end end diff --git a/spec/ruby/core/file/lstat_spec.rb b/spec/ruby/core/file/lstat_spec.rb index 918ed02163..a5ea9d15a5 100644 --- a/spec/ruby/core/file/lstat_spec.rb +++ b/spec/ruby/core/file/lstat_spec.rb @@ -22,8 +22,8 @@ describe "File.lstat" do it "returns a File::Stat object with symlink properties for a symlink" do st = File.lstat(@link) - st.symlink?.should == true - st.file?.should == false + st.should.symlink? + st.should_not.file? end end end diff --git a/spec/ruby/core/file/open_spec.rb b/spec/ruby/core/file/open_spec.rb index 7ceeb47dd8..8faa31173e 100644 --- a/spec/ruby/core/file/open_spec.rb +++ b/spec/ruby/core/file/open_spec.rb @@ -28,7 +28,7 @@ describe "File.open" do describe "with a block" do it "does not raise error when file is closed inside the block" do @fh = File.open(@file) { |fh| fh.close; fh } - @fh.closed?.should == true + @fh.should.closed? end it "invokes close on an opened file when exiting the block" do @@ -485,7 +485,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "w+") do |f| f.pos.should == 0 - f.eof?.should == true + f.should.eof? end File.size(@file).should == 0 end @@ -495,7 +495,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "rb+") do |f| f.pos.should == 0 - f.eof?.should == false + f.should_not.eof? end end @@ -504,7 +504,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "wb+") do |f| f.pos.should == 0 - f.eof?.should == true + f.should.eof? end File.size(@file).should == 0 end diff --git a/spec/ruby/core/file/stat/owned_spec.rb b/spec/ruby/core/file/stat/owned_spec.rb index fbd473c4d7..a23ad850c5 100644 --- a/spec/ruby/core/file/stat/owned_spec.rb +++ b/spec/ruby/core/file/stat/owned_spec.rb @@ -18,7 +18,7 @@ describe "File::Stat#owned?" do it "returns true if the file is owned by the user" do st = File.stat(@file) - st.owned?.should == true + st.should.owned? end platform_is_not :windows, :android do @@ -26,7 +26,7 @@ describe "File::Stat#owned?" do it "returns false if the file is not owned by the user" do system_file = '/etc/passwd' st = File.stat(system_file) - st.owned?.should == false + st.should_not.owned? end end end diff --git a/spec/ruby/core/file/stat/pipe_spec.rb b/spec/ruby/core/file/stat/pipe_spec.rb index 7abb6c742a..692dfbf42a 100644 --- a/spec/ruby/core/file/stat/pipe_spec.rb +++ b/spec/ruby/core/file/stat/pipe_spec.rb @@ -12,7 +12,7 @@ describe "File::Stat#pipe?" do touch(filename) st = File.stat(filename) - st.pipe?.should == false + st.should_not.pipe? rm_r filename end @@ -23,7 +23,7 @@ describe "File::Stat#pipe?" do File.mkfifo(filename) st = File.stat(filename) - st.pipe?.should == true + st.should.pipe? rm_r filename end diff --git a/spec/ruby/core/file/stat_spec.rb b/spec/ruby/core/file/stat_spec.rb index 275eae36d5..6365500057 100644 --- a/spec/ruby/core/file/stat_spec.rb +++ b/spec/ruby/core/file/stat_spec.rb @@ -23,8 +23,8 @@ platform_is_not :windows do st = f.stat - st.file?.should == true - st.zero?.should == false + st.should.file? + st.should_not.zero? st.size.should == 8 st.size?.should == 8 st.blksize.should >= 0 @@ -38,8 +38,8 @@ platform_is_not :windows do File.symlink(@file, @link) st = File.stat(@link) - st.file?.should == true - st.symlink?.should == false + st.should.file? + st.should_not.symlink? end it "returns an error when given missing non-ASCII path" do diff --git a/spec/ruby/core/file/truncate_spec.rb b/spec/ruby/core/file/truncate_spec.rb index 43b86b7382..b4a2e3e577 100644 --- a/spec/ruby/core/file/truncate_spec.rb +++ b/spec/ruby/core/file/truncate_spec.rb @@ -18,7 +18,7 @@ describe "File.truncate" do File.open(@name, "r") do |f| f.read(99).should == "12345" - f.eof?.should == true + f.should.eof? end end @@ -120,7 +120,7 @@ describe "File#truncate" do File.size(@name).should == 5 File.open(@name, "r") do |f| f.read(99).should == "12345" - f.eof?.should == true + f.should.eof? end end @@ -161,7 +161,7 @@ describe "File#truncate" do it "raises an IOError if file is closed" do @file.close - @file.closed?.should == true + @file.should.closed? -> { @file.truncate(42) }.should raise_error(IOError) end diff --git a/spec/ruby/core/float/finite_spec.rb b/spec/ruby/core/float/finite_spec.rb index c5fb3df849..d839b30e32 100644 --- a/spec/ruby/core/float/finite_spec.rb +++ b/spec/ruby/core/float/finite_spec.rb @@ -2,18 +2,18 @@ require_relative '../../spec_helper' describe "Float#finite?" do it "returns true for finite values" do - 3.14159.finite?.should == true + 3.14159.should.finite? end it "returns false for positive infinity" do - infinity_value.finite?.should == false + infinity_value.should_not.finite? end it "returns false for negative infinity" do - (-infinity_value).finite?.should == false + (-infinity_value).should_not.finite? end it "returns false for NaN" do - nan_value.finite?.should == false + nan_value.should_not.finite? end end diff --git a/spec/ruby/core/float/nan_spec.rb b/spec/ruby/core/float/nan_spec.rb index d09d25153c..c1043ef21b 100644 --- a/spec/ruby/core/float/nan_spec.rb +++ b/spec/ruby/core/float/nan_spec.rb @@ -2,8 +2,8 @@ require_relative '../../spec_helper' describe "Float#nan?" do it "returns true if self is not a valid IEEE floating-point number" do - 0.0.nan?.should == false - -1.5.nan?.should == false - nan_value.nan?.should == true + 0.0.should_not.nan? + -1.5.should_not.nan? + nan_value.should.nan? end end diff --git a/spec/ruby/core/float/next_float_spec.rb b/spec/ruby/core/float/next_float_spec.rb index 2f0eff605a..29e2d31146 100644 --- a/spec/ruby/core/float/next_float_spec.rb +++ b/spec/ruby/core/float/next_float_spec.rb @@ -44,6 +44,6 @@ describe "Float#next_float" do end it "returns NAN if NAN was the receiver" do - Float::NAN.next_float.nan?.should == true + Float::NAN.next_float.should.nan? end end diff --git a/spec/ruby/core/float/prev_float_spec.rb b/spec/ruby/core/float/prev_float_spec.rb index 40fcc25a6d..5e50269da7 100644 --- a/spec/ruby/core/float/prev_float_spec.rb +++ b/spec/ruby/core/float/prev_float_spec.rb @@ -44,6 +44,6 @@ describe "Float#prev_float" do end it "returns NAN if NAN was the receiver" do - Float::NAN.prev_float.nan?.should == true + Float::NAN.prev_float.should.nan? end end diff --git a/spec/ruby/core/float/uminus_spec.rb b/spec/ruby/core/float/uminus_spec.rb index e676a26ada..57bae0fb4b 100644 --- a/spec/ruby/core/float/uminus_spec.rb +++ b/spec/ruby/core/float/uminus_spec.rb @@ -23,6 +23,6 @@ describe "Float#-@" do end it "returns NaN for NaN" do - nan_value.send(:-@).nan?.should == true + nan_value.send(:-@).should.nan? end end diff --git a/spec/ruby/core/float/zero_spec.rb b/spec/ruby/core/float/zero_spec.rb index e70edc422a..1f3de27793 100644 --- a/spec/ruby/core/float/zero_spec.rb +++ b/spec/ruby/core/float/zero_spec.rb @@ -2,8 +2,8 @@ require_relative '../../spec_helper' describe "Float#zero?" do it "returns true if self is 0.0" do - 0.0.zero?.should == true - 1.0.zero?.should == false - -1.0.zero?.should == false + 0.0.should.zero? + 1.0.should_not.zero? + -1.0.should_not.zero? end end diff --git a/spec/ruby/core/gc/profiler/disable_spec.rb b/spec/ruby/core/gc/profiler/disable_spec.rb index 321a207deb..74089693eb 100644 --- a/spec/ruby/core/gc/profiler/disable_spec.rb +++ b/spec/ruby/core/gc/profiler/disable_spec.rb @@ -11,6 +11,6 @@ describe "GC::Profiler.disable" do it "disables the profiler" do GC::Profiler.disable - GC::Profiler.enabled?.should == false + GC::Profiler.should_not.enabled? end end diff --git a/spec/ruby/core/gc/profiler/enable_spec.rb b/spec/ruby/core/gc/profiler/enable_spec.rb index 1594511675..313ca3d949 100644 --- a/spec/ruby/core/gc/profiler/enable_spec.rb +++ b/spec/ruby/core/gc/profiler/enable_spec.rb @@ -12,6 +12,6 @@ describe "GC::Profiler.enable" do it "enables the profiler" do GC::Profiler.enable - GC::Profiler.enabled?.should == true + GC::Profiler.should.enabled? end end diff --git a/spec/ruby/core/hash/any_spec.rb b/spec/ruby/core/hash/any_spec.rb index bd33e8cd8f..c26dfabde6 100644 --- a/spec/ruby/core/hash/any_spec.rb +++ b/spec/ruby/core/hash/any_spec.rb @@ -4,10 +4,10 @@ describe "Hash#any?" do describe 'with no block given' do it "checks if there are any members of a Hash" do empty_hash = {} - empty_hash.any?.should == false + empty_hash.should_not.any? hash_with_members = { 'key' => 'value' } - hash_with_members.any?.should == true + hash_with_members.should.any? end end diff --git a/spec/ruby/core/hash/compare_by_identity_spec.rb b/spec/ruby/core/hash/compare_by_identity_spec.rb index 0fd41a4d58..874cd46eb7 100644 --- a/spec/ruby/core/hash/compare_by_identity_spec.rb +++ b/spec/ruby/core/hash/compare_by_identity_spec.rb @@ -33,7 +33,7 @@ describe "Hash#compare_by_identity" do it "has no effect on an already compare_by_identity hash" do @idh[:foo] = :bar @idh.compare_by_identity.should equal @idh - @idh.compare_by_identity?.should == true + @idh.should.compare_by_identity? @idh[:foo].should == :bar end diff --git a/spec/ruby/core/hash/empty_spec.rb b/spec/ruby/core/hash/empty_spec.rb index e9be44bab0..881e1cc34b 100644 --- a/spec/ruby/core/hash/empty_spec.rb +++ b/spec/ruby/core/hash/empty_spec.rb @@ -3,13 +3,13 @@ require_relative 'fixtures/classes' describe "Hash#empty?" do it "returns true if the hash has no entries" do - {}.empty?.should == true - { 1 => 1 }.empty?.should == false + {}.should.empty? + { 1 => 1 }.should_not.empty? end it "returns true if the hash has no entries and has a default value" do - Hash.new(5).empty?.should == true - Hash.new { 5 }.empty?.should == true - Hash.new { |hsh, k| hsh[k] = k }.empty?.should == true + Hash.new(5).should.empty? + Hash.new { 5 }.should.empty? + Hash.new { |hsh, k| hsh[k] = k }.should.empty? end end diff --git a/spec/ruby/core/hash/reject_spec.rb b/spec/ruby/core/hash/reject_spec.rb index 38589fd880..397000ab67 100644 --- a/spec/ruby/core/hash/reject_spec.rb +++ b/spec/ruby/core/hash/reject_spec.rb @@ -35,7 +35,7 @@ describe "Hash#reject" do ruby_version_is ''...'2.7' do it "does not taint the resulting hash" do h = { a: 1 }.taint - h.reject {false}.tainted?.should == false + h.reject {false}.should_not.tainted? end end end diff --git a/spec/ruby/core/hash/shared/store.rb b/spec/ruby/core/hash/shared/store.rb index 6e2557eb28..84ffb41e33 100644 --- a/spec/ruby/core/hash/shared/store.rb +++ b/spec/ruby/core/hash/shared/store.rb @@ -50,7 +50,7 @@ describe :hash_store, shared: true do key << "bar" h.should == { "foo" => 0 } - h.keys[0].frozen?.should == true + h.keys[0].should.frozen? end it "doesn't duplicate and freeze already frozen string keys" do diff --git a/spec/ruby/core/hash/to_proc_spec.rb b/spec/ruby/core/hash/to_proc_spec.rb index 700621f162..8b7ddd5e00 100644 --- a/spec/ruby/core/hash/to_proc_spec.rb +++ b/spec/ruby/core/hash/to_proc_spec.rb @@ -21,13 +21,13 @@ describe "Hash#to_proc" do ruby_version_is ""..."2.8" do it "is not a lambda" do - @proc.lambda?.should == false + @proc.should_not.lambda? end end ruby_version_is "2.8" do it "is a lambda" do - @proc.lambda?.should == true + @proc.should.lambda? end end diff --git a/spec/ruby/core/integer/integer_spec.rb b/spec/ruby/core/integer/integer_spec.rb index f8067cda06..2d5d2e3e92 100644 --- a/spec/ruby/core/integer/integer_spec.rb +++ b/spec/ruby/core/integer/integer_spec.rb @@ -13,8 +13,8 @@ end describe "Integer#integer?" do it "returns true for Integers" do - 0.integer?.should == true - -1.integer?.should == true - bignum_value.integer?.should == true + 0.should.integer? + -1.should.integer? + bignum_value.should.integer? end end diff --git a/spec/ruby/core/io/close_on_exec_spec.rb b/spec/ruby/core/io/close_on_exec_spec.rb index f837bb56af..91bd3c8c40 100644 --- a/spec/ruby/core/io/close_on_exec_spec.rb +++ b/spec/ruby/core/io/close_on_exec_spec.rb @@ -14,24 +14,24 @@ describe "IO#close_on_exec=" do guard -> { platform_is_not :windows } do it "sets the close-on-exec flag if true" do @io.close_on_exec = true - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "sets the close-on-exec flag if non-false" do @io.close_on_exec = :true - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "unsets the close-on-exec flag if false" do @io.close_on_exec = true @io.close_on_exec = false - @io.close_on_exec?.should == false + @io.should_not.close_on_exec? end it "unsets the close-on-exec flag if nil" do @io.close_on_exec = true @io.close_on_exec = nil - @io.close_on_exec?.should == false + @io.should_not.close_on_exec? end it "ensures the IO's file descriptor is closed in exec'ed processes" do @@ -64,12 +64,12 @@ describe "IO#close_on_exec?" do guard -> { platform_is_not :windows } do it "returns true by default" do - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "returns true if set" do @io.close_on_exec = true - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "raises IOError if called on a closed IO" do diff --git a/spec/ruby/core/io/close_read_spec.rb b/spec/ruby/core/io/close_read_spec.rb index 6fa4fc8ff8..26454bfddd 100644 --- a/spec/ruby/core/io/close_read_spec.rb +++ b/spec/ruby/core/io/close_read_spec.rb @@ -49,7 +49,7 @@ describe "IO#close_read" do io.close_read - io.closed?.should == true + io.should.closed? end it "does nothing on closed stream" do diff --git a/spec/ruby/core/io/close_spec.rb b/spec/ruby/core/io/close_spec.rb index 37c8ab5a12..dda82b34de 100644 --- a/spec/ruby/core/io/close_spec.rb +++ b/spec/ruby/core/io/close_spec.rb @@ -14,7 +14,7 @@ describe "IO#close" do it "closes the stream" do @io.close - @io.closed?.should == true + @io.should.closed? end it "returns nil" do diff --git a/spec/ruby/core/io/close_write_spec.rb b/spec/ruby/core/io/close_write_spec.rb index 75e1577654..14835e4e2c 100644 --- a/spec/ruby/core/io/close_write_spec.rb +++ b/spec/ruby/core/io/close_write_spec.rb @@ -45,7 +45,7 @@ describe "IO#close_write" do io.close_write - io.closed?.should == true + io.should.closed? end it "flushes and closes the write stream" do diff --git a/spec/ruby/core/io/dup_spec.rb b/spec/ruby/core/io/dup_spec.rb index de32c5e347..8cadaee118 100644 --- a/spec/ruby/core/io/dup_spec.rb +++ b/spec/ruby/core/io/dup_spec.rb @@ -51,16 +51,16 @@ end @i.close -> { @f.gets }.should_not raise_error(Exception) - @i.closed?.should == true - @f.closed?.should == false + @i.should.closed? + @f.should_not.closed? end it "allows closing the original IO without affecting the new one" do @f.close -> { @i.gets }.should_not raise_error(Exception) - @i.closed?.should == false - @f.closed?.should == true + @i.should_not.closed? + @f.should.closed? end it "raises IOError on closed stream" do @@ -71,7 +71,7 @@ end @f.close_on_exec = true dup = @f.dup begin - dup.close_on_exec?.should == true + dup.should.close_on_exec? ensure dup.close end @@ -79,7 +79,7 @@ end @f.close_on_exec = false dup = @f.dup begin - dup.close_on_exec?.should == true + dup.should.close_on_exec? ensure dup.close end diff --git a/spec/ruby/core/io/eof_spec.rb b/spec/ruby/core/io/eof_spec.rb index 8fd3c37132..315345d942 100644 --- a/spec/ruby/core/io/eof_spec.rb +++ b/spec/ruby/core/io/eof_spec.rb @@ -12,7 +12,7 @@ describe "IO#eof?" do end it "returns true on an empty stream that has just been opened" do - File.open(@name) { |empty| empty.eof?.should == true } + File.open(@name) { |empty| empty.should.eof? } end it "raises IOError on stream not opened for reading" do @@ -34,35 +34,35 @@ describe "IO#eof?" do it "returns false when not at end of file" do @io.read 1 - @io.eof?.should == false + @io.should_not.eof? end it "returns true after reading with read with no parameters" do @io.read() - @io.eof?.should == true + @io.should.eof? end it "returns true after reading with read" do @io.read(File.size(@name)) - @io.eof?.should == true + @io.should.eof? end it "returns true after reading with sysread" do @io.sysread(File.size(@name)) - @io.eof?.should == true + @io.should.eof? end it "returns true after reading with readlines" do @io.readlines - @io.eof?.should == true + @io.should.eof? end it "returns false on just opened non-empty stream" do - @io.eof?.should == false + @io.should_not.eof? end it "does not consume the data from the stream" do - @io.eof?.should == false + @io.should_not.eof? @io.getc.should == 'V' end @@ -78,7 +78,7 @@ describe "IO#eof?" do it "returns true on one-byte stream after single-byte read" do File.open(File.dirname(__FILE__) + '/fixtures/one_byte.txt') { |one_byte| one_byte.read(1) - one_byte.eof?.should == true + one_byte.should.eof? } end end @@ -92,16 +92,16 @@ describe "IO#eof?" do it "returns true on receiving side of Pipe when writing side is closed" do @r, @w = IO.pipe @w.close - @r.eof?.should == true + @r.should.eof? end it "returns false on receiving side of Pipe when writing side wrote some data" do @r, @w = IO.pipe @w.puts "hello" - @r.eof?.should == false + @r.should_not.eof? @w.close - @r.eof?.should == false + @r.should_not.eof? @r.read - @r.eof?.should == true + @r.should.eof? end end diff --git a/spec/ruby/core/io/gets_spec.rb b/spec/ruby/core/io/gets_spec.rb index 39b2108476..a3cd180b66 100644 --- a/spec/ruby/core/io/gets_spec.rb +++ b/spec/ruby/core/io/gets_spec.rb @@ -41,7 +41,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets - line.tainted?.should == true + line.should.tainted? end end end @@ -67,7 +67,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets(nil) - line.tainted?.should == true + line.should.tainted? end end end @@ -103,7 +103,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets("") - line.tainted?.should == true + line.should.tainted? end end end @@ -129,7 +129,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets("la") - line.tainted?.should == true + line.should.tainted? end end end diff --git a/spec/ruby/core/io/pipe_spec.rb b/spec/ruby/core/io/pipe_spec.rb index a7dcb7fab8..2f2cf06f4d 100644 --- a/spec/ruby/core/io/pipe_spec.rb +++ b/spec/ruby/core/io/pipe_spec.rb @@ -44,8 +44,8 @@ describe "IO.pipe" do r, w = IO.pipe do |_r, _w| [_r, _w] end - r.closed?.should == true - w.closed?.should == true + r.should.closed? + w.should.closed? end it "closes both IO objects when the block raises" do @@ -57,8 +57,8 @@ describe "IO.pipe" do raise RuntimeError end end.should raise_error(RuntimeError) - r.closed?.should == true - w.closed?.should == true + r.should.closed? + w.should.closed? end it "allows IO objects to be closed within the block" do @@ -67,8 +67,8 @@ describe "IO.pipe" do _w.close [_r, _w] end - r.closed?.should == true - w.closed?.should == true + r.should.closed? + w.should.closed? end end end diff --git a/spec/ruby/core/io/popen_spec.rb b/spec/ruby/core/io/popen_spec.rb index 4f873e61cd..e9d32c5c7d 100644 --- a/spec/ruby/core/io/popen_spec.rb +++ b/spec/ruby/core/io/popen_spec.rb @@ -77,10 +77,10 @@ describe "IO.popen" do Process.kill "KILL", pid @io.close platform_is_not :windows do - $?.signaled?.should == true + $?.should.signaled? end platform_is :windows do - $?.exited?.should == true + $?.should.exited? end end diff --git a/spec/ruby/core/io/read_nonblock_spec.rb b/spec/ruby/core/io/read_nonblock_spec.rb index 63ccab5a44..e50531d336 100644 --- a/spec/ruby/core/io/read_nonblock_spec.rb +++ b/spec/ruby/core/io/read_nonblock_spec.rb @@ -46,7 +46,7 @@ describe "IO#read_nonblock" do require 'io/nonblock' @write.write "abc" @read.read_nonblock(1).should == "a" - @read.nonblock?.should == true + @read.should.nonblock? end end diff --git a/spec/ruby/core/io/read_spec.rb b/spec/ruby/core/io/read_spec.rb index 1e9a8d2a4f..841e693f37 100644 --- a/spec/ruby/core/io/read_spec.rb +++ b/spec/ruby/core/io/read_spec.rb @@ -216,7 +216,7 @@ describe "IO#read" do it "is at end-of-file when everything has been read" do @io.read - @io.eof?.should == true + @io.should.eof? end it "reads the contents of a file" do diff --git a/spec/ruby/core/io/reopen_spec.rb b/spec/ruby/core/io/reopen_spec.rb index faef80f513..8ff0f217f4 100644 --- a/spec/ruby/core/io/reopen_spec.rb +++ b/spec/ruby/core/io/reopen_spec.rb @@ -150,11 +150,11 @@ describe "IO#reopen with a String" do @io.close_on_exec = true @io.reopen @other_name - @io.close_on_exec?.should == true + @io.should.close_on_exec? @io.close_on_exec = false @io.reopen @other_name - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "creates the file if it doesn't exist if the IO is opened in write mode" do @@ -293,12 +293,12 @@ describe "IO#reopen with an IO" do @other_io.close_on_exec = true @io.close_on_exec = true @io.reopen @other_io - @io.close_on_exec?.should == true + @io.should.close_on_exec? @other_io.close_on_exec = false @io.close_on_exec = false @io.reopen @other_io - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "may change the class of the instance" do diff --git a/spec/ruby/core/io/rewind_spec.rb b/spec/ruby/core/io/rewind_spec.rb index 954d56d30c..649041afaf 100644 --- a/spec/ruby/core/io/rewind_spec.rb +++ b/spec/ruby/core/io/rewind_spec.rb @@ -21,7 +21,7 @@ describe "IO#rewind" do it "positions the instance to the beginning of input and clears EOF" do value = @io.read @io.rewind - @io.eof?.should == false + @io.should_not.eof? value.should == @io.read end diff --git a/spec/ruby/core/io/seek_spec.rb b/spec/ruby/core/io/seek_spec.rb index 7e9c308272..2fa4a73ac9 100644 --- a/spec/ruby/core/io/seek_spec.rb +++ b/spec/ruby/core/io/seek_spec.rb @@ -44,21 +44,21 @@ describe "IO#seek" do it "moves the read position and clears EOF with SEEK_SET" do value = @io.read @io.seek(0, IO::SEEK_SET) - @io.eof?.should == false + @io.should_not.eof? value.should == @io.read end it "moves the read position and clears EOF with SEEK_CUR" do value = @io.read @io.seek(-1, IO::SEEK_CUR) - @io.eof?.should == false + @io.should_not.eof? value[-1].should == @io.read[0] end it "moves the read position and clears EOF with SEEK_END" do value = @io.read @io.seek(-1, IO::SEEK_END) - @io.eof?.should == false + @io.should_not.eof? value[-1].should == @io.read[0] end diff --git a/spec/ruby/core/io/shared/new.rb b/spec/ruby/core/io/shared/new.rb index 27d32f97ed..87f3001862 100644 --- a/spec/ruby/core/io/shared/new.rb +++ b/spec/ruby/core/io/shared/new.rb @@ -148,22 +148,22 @@ describe :io_new, shared: true do it "sets binmode from mode string" do @io = IO.send(@method, @fd, 'wb') - @io.binmode?.should == true + @io.should.binmode? end it "does not set binmode without being asked" do @io = IO.send(@method, @fd, 'w') - @io.binmode?.should == false + @io.should_not.binmode? end it "sets binmode from :binmode option" do @io = IO.send(@method, @fd, 'w', binmode: true) - @io.binmode?.should == true + @io.should.binmode? end it "does not set binmode from false :binmode" do @io = IO.send(@method, @fd, 'w', binmode: false) - @io.binmode?.should == false + @io.should_not.binmode? end it "sets external encoding to binary with binmode in mode string" do @@ -270,13 +270,13 @@ describe :io_new, shared: true do it "accepts an :autoclose option" do @io = IO.send(@method, @fd, 'w', autoclose: false) - @io.autoclose?.should == false + @io.should_not.autoclose? @io.autoclose = true end it "accepts any truthy option :autoclose" do @io = IO.send(@method, @fd, 'w', autoclose: 42) - @io.autoclose?.should == true + @io.should.autoclose? end end diff --git a/spec/ruby/core/io/shared/pos.rb b/spec/ruby/core/io/shared/pos.rb index fb6d8087bc..0b4d1e13b3 100644 --- a/spec/ruby/core/io/shared/pos.rb +++ b/spec/ruby/core/io/shared/pos.rb @@ -27,7 +27,7 @@ describe :io_pos, shared: true do io.read 1 io.read 1 io.send(@method) - io.eof?.should == false + io.should_not.eof? end end end diff --git a/spec/ruby/core/io/ungetc_spec.rb b/spec/ruby/core/io/ungetc_spec.rb index 4be0e3aa8b..85c15b5a71 100644 --- a/spec/ruby/core/io/ungetc_spec.rb +++ b/spec/ruby/core/io/ungetc_spec.rb @@ -74,10 +74,10 @@ describe "IO#ungetc" do touch(@empty) File.open(@empty) { |empty| - empty.eof?.should == true + empty.should.eof? empty.getc.should == nil empty.ungetc(100) - empty.eof?.should == false + empty.should_not.eof? } end diff --git a/spec/ruby/core/io/write_nonblock_spec.rb b/spec/ruby/core/io/write_nonblock_spec.rb index 5474e5c6ce..a8b9ce0a36 100644 --- a/spec/ruby/core/io/write_nonblock_spec.rb +++ b/spec/ruby/core/io/write_nonblock_spec.rb @@ -79,7 +79,7 @@ describe 'IO#write_nonblock' do it 'sets the IO in nonblock mode' do require 'io/nonblock' @write.write_nonblock('a') - @write.nonblock?.should == true + @write.should.nonblock? end end end diff --git a/spec/ruby/core/kernel/backtick_spec.rb b/spec/ruby/core/kernel/backtick_spec.rb index 5ab0fb0eea..391583b539 100644 --- a/spec/ruby/core/kernel/backtick_spec.rb +++ b/spec/ruby/core/kernel/backtick_spec.rb @@ -40,16 +40,16 @@ describe "Kernel#`" do ip = 'world' `echo disc #{ip}` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 0 - $?.success?.should == true + $?.should.success? `echo disc #{ip}; exit 99` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 99 - $?.success?.should == false + $?.should_not.success? end end @@ -58,16 +58,16 @@ describe "Kernel#`" do ip = 'world' `echo disc #{ip}` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 0 - $?.success?.should == true + $?.should.success? `echo disc #{ip}& exit 99` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 99 - $?.success?.should == false + $?.should_not.success? end end end diff --git a/spec/ruby/core/kernel/caller_locations_spec.rb b/spec/ruby/core/kernel/caller_locations_spec.rb index cb344e16a0..c4e0084085 100644 --- a/spec/ruby/core/kernel/caller_locations_spec.rb +++ b/spec/ruby/core/kernel/caller_locations_spec.rb @@ -7,7 +7,7 @@ describe 'Kernel#caller_locations' do end it 'returns an Array of caller locations' do - KernelSpecs::CallerLocationsTest.locations.empty?.should == false + KernelSpecs::CallerLocationsTest.locations.should_not.empty? end it 'returns an Array of caller locations using a custom offset' do diff --git a/spec/ruby/core/kernel/caller_spec.rb b/spec/ruby/core/kernel/caller_spec.rb index e943e36dc2..b71060770c 100644 --- a/spec/ruby/core/kernel/caller_spec.rb +++ b/spec/ruby/core/kernel/caller_spec.rb @@ -7,7 +7,7 @@ describe 'Kernel#caller' do end it 'returns an Array of caller locations' do - KernelSpecs::CallerTest.locations.empty?.should == false + KernelSpecs::CallerTest.locations.should_not.empty? end it 'returns an Array of caller locations using a custom offset' do diff --git a/spec/ruby/core/kernel/clone_spec.rb b/spec/ruby/core/kernel/clone_spec.rb index 1bbef64f85..6aeb57f55b 100644 --- a/spec/ruby/core/kernel/clone_spec.rb +++ b/spec/ruby/core/kernel/clone_spec.rb @@ -33,22 +33,22 @@ describe "Kernel#clone" do @obj.freeze o3 = @obj.clone - o2.frozen?.should == false - o3.frozen?.should == true + o2.should_not.frozen? + o3.should.frozen? end ruby_version_is '2.8' do it 'takes an freeze: true option to frozen copy' do - @obj.clone(freeze: true).frozen?.should == true + @obj.clone(freeze: true).should.frozen? @obj.freeze - @obj.clone(freeze: true).frozen?.should == true + @obj.clone(freeze: true).should.frozen? end end it 'takes an freeze: false option to not return frozen copy' do - @obj.clone(freeze: false).frozen?.should == false + @obj.clone(freeze: false).should_not.frozen? @obj.freeze - @obj.clone(freeze: false).frozen?.should == false + @obj.clone(freeze: false).should_not.frozen? end it "copies instance variables" do diff --git a/spec/ruby/core/kernel/dup_spec.rb b/spec/ruby/core/kernel/dup_spec.rb index fe0a269d69..70198abdb7 100644 --- a/spec/ruby/core/kernel/dup_spec.rb +++ b/spec/ruby/core/kernel/dup_spec.rb @@ -32,7 +32,7 @@ describe "Kernel#dup" do @obj.freeze dup = @obj.dup - dup.frozen?.should == false + dup.should_not.frozen? end it "copies instance variables" do diff --git a/spec/ruby/core/kernel/frozen_spec.rb b/spec/ruby/core/kernel/frozen_spec.rb index 54edae15b1..a4cec4263d 100644 --- a/spec/ruby/core/kernel/frozen_spec.rb +++ b/spec/ruby/core/kernel/frozen_spec.rb @@ -6,8 +6,8 @@ describe "Kernel#frozen?" do o = mock('o') p = mock('p') p.freeze - o.frozen?.should == false - p.frozen?.should == true + o.should_not.frozen? + p.should.frozen? end describe "on true, false and nil" do diff --git a/spec/ruby/core/kernel/shared/dup_clone.rb b/spec/ruby/core/kernel/shared/dup_clone.rb index 968efd80f3..84ad49cbde 100644 --- a/spec/ruby/core/kernel/shared/dup_clone.rb +++ b/spec/ruby/core/kernel/shared/dup_clone.rb @@ -59,8 +59,8 @@ describe :kernel_dup_clone, shared: true do o.taint o3 = o.send(@method) - o2.tainted?.should == false - o3.tainted?.should == true + o2.should_not.tainted? + o3.should.tainted? end end @@ -78,8 +78,8 @@ describe :kernel_dup_clone, shared: true do o.untrust o3 = o.send(@method) - o2.untrusted?.should == false - o3.untrusted?.should == true + o2.should_not.untrusted? + o3.should.untrusted? end end diff --git a/spec/ruby/core/kernel/system_spec.rb b/spec/ruby/core/kernel/system_spec.rb index 9196a9f9f1..696e6ae3d7 100644 --- a/spec/ruby/core/kernel/system_spec.rb +++ b/spec/ruby/core/kernel/system_spec.rb @@ -6,14 +6,14 @@ describe :kernel_system, shared: true do -> { @object.system("echo a") }.should output_to_fd("a\n") $?.should be_an_instance_of Process::Status - $?.success?.should == true + $?.should.success? end it "returns true when the command exits with a zero exit status" do @object.system(ruby_cmd('exit 0')).should == true $?.should be_an_instance_of Process::Status - $?.success?.should == true + $?.should.success? $?.exitstatus.should == 0 end @@ -21,7 +21,7 @@ describe :kernel_system, shared: true do @object.system(ruby_cmd('exit 1')).should == false $?.should be_an_instance_of Process::Status - $?.success?.should == false + $?.should_not.success? $?.exitstatus.should == 1 end diff --git a/spec/ruby/core/kernel/taint_spec.rb b/spec/ruby/core/kernel/taint_spec.rb index 2d2b34d0d0..060e73963e 100644 --- a/spec/ruby/core/kernel/taint_spec.rb +++ b/spec/ruby/core/kernel/taint_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#taint" do it "sets the tainted bit" do o = Object.new o.taint - o.tainted?.should == true + o.should.tainted? end it "raises FrozenError on an untainted, frozen object" do @@ -27,20 +27,20 @@ describe "Kernel#taint" do it "has no effect on immediate values" do [nil, true, false].each do |v| v.taint - v.tainted?.should == false + v.should_not.tainted? end end it "no raises a RuntimeError on symbols" do v = :sym -> { v.taint }.should_not raise_error(RuntimeError) - v.tainted?.should == false + v.should_not.tainted? end it "no raises error on fixnum values" do [1].each do |v| -> { v.taint }.should_not raise_error(RuntimeError) - v.tainted?.should == false + v.should_not.tainted? end end end diff --git a/spec/ruby/core/kernel/tainted_spec.rb b/spec/ruby/core/kernel/tainted_spec.rb index 72ce346dda..dbd6bc939a 100644 --- a/spec/ruby/core/kernel/tainted_spec.rb +++ b/spec/ruby/core/kernel/tainted_spec.rb @@ -7,8 +7,8 @@ describe "Kernel#tainted?" do o = mock('o') p = mock('p') p.taint - o.tainted?.should == false - p.tainted?.should == true + o.should_not.tainted? + p.should.tainted? end end end diff --git a/spec/ruby/core/kernel/trust_spec.rb b/spec/ruby/core/kernel/trust_spec.rb index dbc05b45d4..1d209ea1dc 100644 --- a/spec/ruby/core/kernel/trust_spec.rb +++ b/spec/ruby/core/kernel/trust_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#trust" do it "clears the untrusted bit" do o = Object.new.untrust o.trust - o.untrusted?.should == false + o.should_not.untrusted? end it "raises FrozenError on an untrusted, frozen object" do diff --git a/spec/ruby/core/kernel/untaint_spec.rb b/spec/ruby/core/kernel/untaint_spec.rb index df9e3144a0..171d32b356 100644 --- a/spec/ruby/core/kernel/untaint_spec.rb +++ b/spec/ruby/core/kernel/untaint_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#untaint" do it "clears the tainted bit" do o = Object.new.taint o.untaint - o.tainted?.should == false + o.should_not.tainted? end it "raises FrozenError on a tainted, frozen object" do diff --git a/spec/ruby/core/kernel/untrust_spec.rb b/spec/ruby/core/kernel/untrust_spec.rb index c5a36e1a1d..fca7c9ea47 100644 --- a/spec/ruby/core/kernel/untrust_spec.rb +++ b/spec/ruby/core/kernel/untrust_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#untrust" do it "sets the untrusted bit" do o = Object.new o.untrust - o.untrusted?.should == true + o.should.untrusted? end it "raises FrozenError on a trusted, frozen object" do diff --git a/spec/ruby/core/kernel/untrusted_spec.rb b/spec/ruby/core/kernel/untrusted_spec.rb index ccebfe38be..65cbffa3ad 100644 --- a/spec/ruby/core/kernel/untrusted_spec.rb +++ b/spec/ruby/core/kernel/untrusted_spec.rb @@ -5,9 +5,9 @@ describe "Kernel#untrusted?" do ruby_version_is ''...'2.7' do it "returns the untrusted status of an object" do o = mock('o') - o.untrusted?.should == false + o.should_not.untrusted? o.untrust - o.untrusted?.should == true + o.should.untrusted? end it "has no effect on immediate values" do @@ -17,9 +17,9 @@ describe "Kernel#untrusted?" do a.untrust b.untrust c.untrust - a.untrusted?.should == false - b.untrusted?.should == false - c.untrusted?.should == false + a.should_not.untrusted? + b.should_not.untrusted? + c.should_not.untrusted? end it "has effect on immediate values" do diff --git a/spec/ruby/core/matchdata/string_spec.rb b/spec/ruby/core/matchdata/string_spec.rb index db0d5dfbdc..420233e1f3 100644 --- a/spec/ruby/core/matchdata/string_spec.rb +++ b/spec/ruby/core/matchdata/string_spec.rb @@ -9,7 +9,7 @@ describe "MatchData#string" do it "returns a frozen copy of the match string" do str = /(.)(.)(\d+)(\d)/.match("THX1138.").string str.should == "THX1138." - str.frozen?.should == true + str.should.frozen? end it "returns the same frozen string for every call" do @@ -20,6 +20,6 @@ describe "MatchData#string" do it "returns a frozen copy of the matched string for gsub(String)" do 'he[[o'.gsub!('[', ']') $~.string.should == 'he[[o' - $~.string.frozen?.should == true + $~.string.should.frozen? end end diff --git a/spec/ruby/core/math/tan_spec.rb b/spec/ruby/core/math/tan_spec.rb index c7b188cd81..67307f1e6e 100644 --- a/spec/ruby/core/math/tan_spec.rb +++ b/spec/ruby/core/math/tan_spec.rb @@ -14,8 +14,8 @@ describe "Math.tan" do end it "returns NaN if called with +-Infinity" do - Math.tan(infinity_value).nan?.should == true - Math.tan(-infinity_value).nan?.should == true + Math.tan(infinity_value).should.nan? + Math.tan(-infinity_value).should.nan? end it "raises a TypeError if the argument cannot be coerced with Float()" do diff --git a/spec/ruby/core/method/compose_spec.rb b/spec/ruby/core/method/compose_spec.rb index 2cf5b21670..0e2a0eeea2 100644 --- a/spec/ruby/core/method/compose_spec.rb +++ b/spec/ruby/core/method/compose_spec.rb @@ -39,8 +39,8 @@ ruby_version_is "2.6" do double = proc { |x| x + x } (pow_2 << double).is_a?(Proc).should == true - ruby_version_is(''...'2.8') { (pow_2 << double).lambda?.should == true } - ruby_version_is('2.8') { (pow_2 << double).lambda?.should == false } + ruby_version_is(''...'2.8') { (pow_2 << double).should.lambda? } + ruby_version_is('2.8') { (pow_2 << double).should_not.lambda? } end it "may accept multiple arguments" do @@ -88,7 +88,7 @@ ruby_version_is "2.6" do double = proc { |x| x + x } (pow_2 >> double).is_a?(Proc).should == true - (pow_2 >> double).lambda?.should == true + (pow_2 >> double).should.lambda? end it "may accept multiple arguments" do diff --git a/spec/ruby/core/module/included_spec.rb b/spec/ruby/core/module/included_spec.rb index f8dbad1d31..2fdd4325f2 100644 --- a/spec/ruby/core/module/included_spec.rb +++ b/spec/ruby/core/module/included_spec.rb @@ -39,6 +39,6 @@ describe "Module#included" do it "works with super using a singleton class" do ModuleSpecs::SingletonOnModuleCase::Bar.include ModuleSpecs::SingletonOnModuleCase::Foo - ModuleSpecs::SingletonOnModuleCase::Bar.included_called?.should == true + ModuleSpecs::SingletonOnModuleCase::Bar.should.included_called? end end diff --git a/spec/ruby/core/module/name_spec.rb b/spec/ruby/core/module/name_spec.rb index 9a4730313f..ae8037555b 100644 --- a/spec/ruby/core/module/name_spec.rb +++ b/spec/ruby/core/module/name_spec.rb @@ -122,7 +122,7 @@ describe "Module#name" do ruby_version_is "2.7" do it "returns a frozen String" do - ModuleSpecs.name.frozen?.should == true + ModuleSpecs.name.should.frozen? end it "always returns the same String for a given Module" do diff --git a/spec/ruby/core/module/singleton_class_spec.rb b/spec/ruby/core/module/singleton_class_spec.rb index b9f78eeb21..052755b73b 100644 --- a/spec/ruby/core/module/singleton_class_spec.rb +++ b/spec/ruby/core/module/singleton_class_spec.rb @@ -3,25 +3,25 @@ require_relative '../../spec_helper' describe "Module#singleton_class?" do it "returns true for singleton classes" do xs = self.singleton_class - xs.singleton_class?.should == true + xs.should.singleton_class? end it "returns false for other classes" do c = Class.new - c.singleton_class?.should == false + c.should_not.singleton_class? end describe "with singleton values" do it "returns false for nil's singleton class" do - NilClass.singleton_class?.should == false + NilClass.should_not.singleton_class? end it "returns false for true's singleton class" do - TrueClass.singleton_class?.should == false + TrueClass.should_not.singleton_class? end it "returns false for false's singleton class" do - FalseClass.singleton_class?.should == false + FalseClass.should_not.singleton_class? end end end diff --git a/spec/ruby/core/nil/nil_spec.rb b/spec/ruby/core/nil/nil_spec.rb index 47db0c5cf0..2cf97621c6 100644 --- a/spec/ruby/core/nil/nil_spec.rb +++ b/spec/ruby/core/nil/nil_spec.rb @@ -2,6 +2,6 @@ require_relative '../../spec_helper' describe "NilClass#nil?" do it "returns true" do - nil.nil?.should == true + nil.should.nil? end end diff --git a/spec/ruby/core/nil/to_s_spec.rb b/spec/ruby/core/nil/to_s_spec.rb index 4b61f589f7..283d26477a 100644 --- a/spec/ruby/core/nil/to_s_spec.rb +++ b/spec/ruby/core/nil/to_s_spec.rb @@ -7,7 +7,7 @@ describe "NilClass#to_s" do ruby_version_is "2.7" do it "returns a frozen string" do - nil.to_s.frozen?.should == true + nil.to_s.should.frozen? end it "always returns the same string" do diff --git a/spec/ruby/core/numeric/integer_spec.rb b/spec/ruby/core/numeric/integer_spec.rb index 5d4bf00360..adbac4d7aa 100644 --- a/spec/ruby/core/numeric/integer_spec.rb +++ b/spec/ruby/core/numeric/integer_spec.rb @@ -3,6 +3,6 @@ require_relative 'fixtures/classes' describe "Numeric#integer?" do it "returns false" do - NumericSpecs::Subclass.new.integer?.should == false + NumericSpecs::Subclass.new.should_not.integer? end end diff --git a/spec/ruby/core/numeric/negative_spec.rb b/spec/ruby/core/numeric/negative_spec.rb index da464a9094..9c6f95fd87 100644 --- a/spec/ruby/core/numeric/negative_spec.rb +++ b/spec/ruby/core/numeric/negative_spec.rb @@ -31,11 +31,11 @@ describe "Numeric#negative?" do it "returns true if self is less than 0" do @obj.should_receive(:<).with(0).and_return(true) - @obj.negative?.should == true + @obj.should.negative? end it "returns false if self is greater than 0" do @obj.should_receive(:<).with(0).and_return(false) - @obj.negative?.should == false + @obj.should_not.negative? end end diff --git a/spec/ruby/core/numeric/positive_spec.rb b/spec/ruby/core/numeric/positive_spec.rb index 8f98fbfa26..3b831b4d34 100644 --- a/spec/ruby/core/numeric/positive_spec.rb +++ b/spec/ruby/core/numeric/positive_spec.rb @@ -31,11 +31,11 @@ describe "Numeric#positive?" do it "returns true if self is greater than 0" do @obj.should_receive(:>).with(0).and_return(true) - @obj.positive?.should == true + @obj.should.positive? end it "returns false if self is less than 0" do @obj.should_receive(:>).with(0).and_return(false) - @obj.positive?.should == false + @obj.should_not.positive? end end diff --git a/spec/ruby/core/numeric/real_spec.rb b/spec/ruby/core/numeric/real_spec.rb index caa8dcec6d..2d2499bcce 100644 --- a/spec/ruby/core/numeric/real_spec.rb +++ b/spec/ruby/core/numeric/real_spec.rb @@ -32,6 +32,6 @@ end describe "Numeric#real?" do it "returns true" do - NumericSpecs::Subclass.new.real?.should == true + NumericSpecs::Subclass.new.should.real? end end diff --git a/spec/ruby/core/numeric/zero_spec.rb b/spec/ruby/core/numeric/zero_spec.rb index 9de71d1dc9..0fb7619bcd 100644 --- a/spec/ruby/core/numeric/zero_spec.rb +++ b/spec/ruby/core/numeric/zero_spec.rb @@ -8,11 +8,11 @@ describe "Numeric#zero?" do it "returns true if self is 0" do @obj.should_receive(:==).with(0).and_return(true) - @obj.zero?.should == true + @obj.should.zero? end it "returns false if self is not 0" do @obj.should_receive(:==).with(0).and_return(false) - @obj.zero?.should == false + @obj.should_not.zero? end end diff --git a/spec/ruby/core/proc/compose_spec.rb b/spec/ruby/core/proc/compose_spec.rb index ef9c125ae9..efdbdeacf4 100644 --- a/spec/ruby/core/proc/compose_spec.rb +++ b/spec/ruby/core/proc/compose_spec.rb @@ -35,7 +35,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == false + (f << g).should_not.lambda? end ruby_version_is(''...'2.8') do @@ -44,7 +44,7 @@ ruby_version_is "2.6" do g = -> x { x + x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == false + (f << g).should_not.lambda? end it "is a lambda when self is lambda" do @@ -52,7 +52,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == true + (f << g).should.lambda? end end @@ -63,8 +63,8 @@ ruby_version_is "2.6" do lambda_proc = -> x { x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == false - (f << lambda_proc).lambda?.should == true + (f << g).should_not.lambda? + (f << lambda_proc).should.lambda? end end @@ -118,7 +118,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f >> g).is_a?(Proc).should == true - (f >> g).lambda?.should == false + (f >> g).should_not.lambda? end it "is a Proc when other is lambda" do @@ -126,7 +126,7 @@ ruby_version_is "2.6" do g = -> x { x + x } (f >> g).is_a?(Proc).should == true - (f >> g).lambda?.should == false + (f >> g).should_not.lambda? end it "is a lambda when self is lambda" do @@ -134,7 +134,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f >> g).is_a?(Proc).should == true - (f >> g).lambda?.should == true + (f >> g).should.lambda? end it "may accept multiple arguments" do diff --git a/spec/ruby/core/range/dup_spec.rb b/spec/ruby/core/range/dup_spec.rb index d1c029c6b7..6c9d0c954a 100644 --- a/spec/ruby/core/range/dup_spec.rb +++ b/spec/ruby/core/range/dup_spec.rb @@ -5,11 +5,11 @@ describe "Range#dup" do copy = (1..3).dup copy.begin.should == 1 copy.end.should == 3 - copy.exclude_end?.should == false + copy.should_not.exclude_end? copy = ("a"..."z").dup copy.begin.should == "a" copy.end.should == "z" - copy.exclude_end?.should == true + copy.should.exclude_end? end end diff --git a/spec/ruby/core/range/exclude_end_spec.rb b/spec/ruby/core/range/exclude_end_spec.rb index a209603d18..c4006fea78 100644 --- a/spec/ruby/core/range/exclude_end_spec.rb +++ b/spec/ruby/core/range/exclude_end_spec.rb @@ -2,18 +2,18 @@ require_relative '../../spec_helper' describe "Range#exclude_end?" do it "returns false if the range does not exclude the end value" do - (-2..2).exclude_end?.should == false - ('A'..'B').exclude_end?.should == false - (0.5..2.4).exclude_end?.should == false - (0xfffd..0xffff).exclude_end?.should == false - Range.new(0, 1).exclude_end?.should == false + (-2..2).should_not.exclude_end? + ('A'..'B').should_not.exclude_end? + (0.5..2.4).should_not.exclude_end? + (0xfffd..0xffff).should_not.exclude_end? + Range.new(0, 1).should_not.exclude_end? end it "returns true if the range excludes the end value" do - (0...5).exclude_end?.should == true - ('A'...'B').exclude_end?.should == true - (0.5...2.4).exclude_end?.should == true - (0xfffd...0xffff).exclude_end?.should == true - Range.new(0, 1, true).exclude_end?.should == true + (0...5).should.exclude_end? + ('A'...'B').should.exclude_end? + (0.5...2.4).should.exclude_end? + (0xfffd...0xffff).should.exclude_end? + Range.new(0, 1, true).should.exclude_end? end end diff --git a/spec/ruby/core/regexp/casefold_spec.rb b/spec/ruby/core/regexp/casefold_spec.rb index d84a2d63c9..d36467a989 100644 --- a/spec/ruby/core/regexp/casefold_spec.rb +++ b/spec/ruby/core/regexp/casefold_spec.rb @@ -2,7 +2,7 @@ require_relative '../../spec_helper' describe "Regexp#casefold?" do it "returns the value of the case-insensitive flag" do - /abc/i.casefold?.should == true - /xyz/.casefold?.should == false + /abc/i.should.casefold? + /xyz/.should_not.casefold? end end diff --git a/spec/ruby/core/signal/trap_spec.rb b/spec/ruby/core/signal/trap_spec.rb index 91ce1f1348..831a5ee23e 100644 --- a/spec/ruby/core/signal/trap_spec.rb +++ b/spec/ruby/core/signal/trap_spec.rb @@ -155,7 +155,7 @@ platform_is_not :windows do out = ruby_exe(code) status = $? out.should == "nil\n" - status.signaled?.should == true + status.should.signaled? status.termsig.should be_kind_of(Integer) Signal.signame(status.termsig).should == "PIPE" end diff --git a/spec/ruby/core/string/capitalize_spec.rb b/spec/ruby/core/string/capitalize_spec.rb index 66d3b75f48..e6cf365ac3 100644 --- a/spec/ruby/core/string/capitalize_spec.rb +++ b/spec/ruby/core/string/capitalize_spec.rb @@ -14,8 +14,8 @@ describe "String#capitalize" do ruby_version_is ''...'2.7' do it "taints resulting string when self is tainted" do - "".taint.capitalize.tainted?.should == true - "hello".taint.capitalize.tainted?.should == true + "".taint.capitalize.should.tainted? + "hello".taint.capitalize.should.tainted? end end diff --git a/spec/ruby/core/string/center_spec.rb b/spec/ruby/core/string/center_spec.rb index 0284fc28dc..8a4be0a81e 100644 --- a/spec/ruby/core/string/center_spec.rb +++ b/spec/ruby/core/string/center_spec.rb @@ -49,11 +49,11 @@ describe "String#center with length, padding" do ruby_version_is ''...'2.7' do it "taints result when self or padstr is tainted" do - "x".taint.center(4).tainted?.should == true - "x".taint.center(0).tainted?.should == true - "".taint.center(0).tainted?.should == true - "x".taint.center(4, "*").tainted?.should == true - "x".center(4, "*".taint).tainted?.should == true + "x".taint.center(4).should.tainted? + "x".taint.center(0).should.tainted? + "".taint.center(0).should.tainted? + "x".taint.center(4, "*").should.tainted? + "x".center(4, "*".taint).should.tainted? end end diff --git a/spec/ruby/core/string/chop_spec.rb b/spec/ruby/core/string/chop_spec.rb index e9cd8f51d2..582d3c58c5 100644 --- a/spec/ruby/core/string/chop_spec.rb +++ b/spec/ruby/core/string/chop_spec.rb @@ -51,13 +51,13 @@ describe "String#chop" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "hello".taint.chop.tainted?.should == true - "".taint.chop.tainted?.should == true + "hello".taint.chop.should.tainted? + "".taint.chop.should.tainted? end it "untrusts result when self is untrusted" do - "hello".untrust.chop.untrusted?.should == true - "".untrust.chop.untrusted?.should == true + "hello".untrust.chop.should.untrusted? + "".untrust.chop.should.untrusted? end end diff --git a/spec/ruby/core/string/crypt_spec.rb b/spec/ruby/core/string/crypt_spec.rb index 6a9a4ae235..b947702492 100644 --- a/spec/ruby/core/string/crypt_spec.rb +++ b/spec/ruby/core/string/crypt_spec.rb @@ -33,10 +33,10 @@ describe "String#crypt" do tainted_salt.taint tainted_str.taint - "mypassword".crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").tainted?.should == false - tainted_str.crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").tainted?.should == true - "mypassword".crypt(tainted_salt).tainted?.should == true - tainted_str.crypt(tainted_salt).tainted?.should == true + "mypassword".crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").should_not.tainted? + tainted_str.crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").should.tainted? + "mypassword".crypt(tainted_salt).should.tainted? + tainted_str.crypt(tainted_salt).should.tainted? end end @@ -93,10 +93,10 @@ describe "String#crypt" do tainted_salt.taint tainted_str.taint - "hello".crypt("aa").tainted?.should == false - tainted_str.crypt("aa").tainted?.should == true - "hello".crypt(tainted_salt).tainted?.should == true - tainted_str.crypt(tainted_salt).tainted?.should == true + "hello".crypt("aa").should_not.tainted? + tainted_str.crypt("aa").should.tainted? + "hello".crypt(tainted_salt).should.tainted? + tainted_str.crypt(tainted_salt).should.tainted? end end diff --git a/spec/ruby/core/string/delete_prefix_spec.rb b/spec/ruby/core/string/delete_prefix_spec.rb index fb00d808b2..bd5b56a312 100644 --- a/spec/ruby/core/string/delete_prefix_spec.rb +++ b/spec/ruby/core/string/delete_prefix_spec.rb @@ -23,8 +23,8 @@ describe "String#delete_prefix" do ruby_version_is ''...'2.7' do it "taints resulting strings when other is tainted" do - 'hello'.taint.delete_prefix('hell').tainted?.should == true - 'hello'.taint.delete_prefix('').tainted?.should == true + 'hello'.taint.delete_prefix('hell').should.tainted? + 'hello'.taint.delete_prefix('').should.tainted? end end diff --git a/spec/ruby/core/string/delete_spec.rb b/spec/ruby/core/string/delete_spec.rb index ded63f1719..b6e54f8386 100644 --- a/spec/ruby/core/string/delete_spec.rb +++ b/spec/ruby/core/string/delete_spec.rb @@ -70,10 +70,10 @@ describe "String#delete" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "hello".taint.delete("e").tainted?.should == true - "hello".taint.delete("a-z").tainted?.should == true + "hello".taint.delete("e").should.tainted? + "hello".taint.delete("a-z").should.tainted? - "hello".delete("e".taint).tainted?.should == false + "hello".delete("e".taint).should_not.tainted? end end diff --git a/spec/ruby/core/string/delete_suffix_spec.rb b/spec/ruby/core/string/delete_suffix_spec.rb index d5b6880193..dbb5f9df9e 100644 --- a/spec/ruby/core/string/delete_suffix_spec.rb +++ b/spec/ruby/core/string/delete_suffix_spec.rb @@ -23,8 +23,8 @@ describe "String#delete_suffix" do ruby_version_is ''...'2.7' do it "taints resulting strings when other is tainted" do - 'hello'.taint.delete_suffix('ello').tainted?.should == true - 'hello'.taint.delete_suffix('').tainted?.should == true + 'hello'.taint.delete_suffix('ello').should.tainted? + 'hello'.taint.delete_suffix('').should.tainted? end end diff --git a/spec/ruby/core/string/downcase_spec.rb b/spec/ruby/core/string/downcase_spec.rb index 32e04e8a2c..8c840bdcc4 100644 --- a/spec/ruby/core/string/downcase_spec.rb +++ b/spec/ruby/core/string/downcase_spec.rb @@ -70,9 +70,9 @@ describe "String#downcase" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "".taint.downcase.tainted?.should == true - "x".taint.downcase.tainted?.should == true - "X".taint.downcase.tainted?.should == true + "".taint.downcase.should.tainted? + "x".taint.downcase.should.tainted? + "X".taint.downcase.should.tainted? end end diff --git a/spec/ruby/core/string/dump_spec.rb b/spec/ruby/core/string/dump_spec.rb index 260ee37adb..ebdd0167aa 100644 --- a/spec/ruby/core/string/dump_spec.rb +++ b/spec/ruby/core/string/dump_spec.rb @@ -5,18 +5,18 @@ require_relative 'fixtures/classes' describe "String#dump" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - "foo".taint.dump.tainted?.should == true - "foo\n".taint.dump.tainted?.should == true + "foo".taint.dump.should.tainted? + "foo\n".taint.dump.should.tainted? end it "untrusts the result if self is untrusted" do - "foo".untrust.dump.untrusted?.should == true - "foo\n".untrust.dump.untrusted?.should == true + "foo".untrust.dump.should.untrusted? + "foo\n".untrust.dump.should.untrusted? end end it "does not take into account if a string is frozen" do - "foo".freeze.dump.frozen?.should == false + "foo".freeze.dump.should_not.frozen? end it "returns a subclass instance" do diff --git a/spec/ruby/core/string/element_set_spec.rb b/spec/ruby/core/string/element_set_spec.rb index e375b4570e..641d46bc91 100644 --- a/spec/ruby/core/string/element_set_spec.rb +++ b/spec/ruby/core/string/element_set_spec.rb @@ -18,11 +18,11 @@ describe "String#[]= with Fixnum index" do it "taints self if other_str is tainted" do a = "hello" a[0] = "".taint - a.tainted?.should == true + a.should.tainted? a = "hello" a[0] = "x".taint - a.tainted?.should == true + a.should.tainted? end end @@ -491,11 +491,11 @@ describe "String#[]= with Fixnum index, count" do it "taints self if other_str is tainted" do a = "hello" a[0, 0] = "".taint - a.tainted?.should == true + a.should.tainted? a = "hello" a[1, 4] = "x".taint - a.tainted?.should == true + a.should.tainted? end end diff --git a/spec/ruby/core/string/empty_spec.rb b/spec/ruby/core/string/empty_spec.rb index fb52070723..8e53a16afc 100644 --- a/spec/ruby/core/string/empty_spec.rb +++ b/spec/ruby/core/string/empty_spec.rb @@ -3,10 +3,10 @@ require_relative 'fixtures/classes' describe "String#empty?" do it "returns true if the string has a length of zero" do - "hello".empty?.should == false - " ".empty?.should == false - "\x00".empty?.should == false - "".empty?.should == true - StringSpecs::MyString.new("").empty?.should == true + "hello".should_not.empty? + " ".should_not.empty? + "\x00".should_not.empty? + "".should.empty? + StringSpecs::MyString.new("").should.empty? end end diff --git a/spec/ruby/core/string/gsub_spec.rb b/spec/ruby/core/string/gsub_spec.rb index 8193464d48..23e0ad2260 100644 --- a/spec/ruby/core/string/gsub_spec.rb +++ b/spec/ruby/core/string/gsub_spec.rb @@ -171,14 +171,14 @@ describe "String#gsub with pattern and replacement" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.gsub(/./, a).tainted?.should == true - hello_t.gsub(/./, empty).tainted?.should == true + hello_t.gsub(/./, a).should.tainted? + hello_t.gsub(/./, empty).should.tainted? - hello.gsub(/./, a_t).tainted?.should == true - hello.gsub(/./, empty_t).tainted?.should == true - hello.gsub(//, empty_t).tainted?.should == true + hello.gsub(/./, a_t).should.tainted? + hello.gsub(/./, empty_t).should.tainted? + hello.gsub(//, empty_t).should.tainted? - hello.gsub(//.taint, "foo").tainted?.should == false + hello.gsub(//.taint, "foo").should_not.tainted? end end @@ -199,14 +199,14 @@ describe "String#gsub with pattern and replacement" do hello_t.untrust; a_t.untrust; empty_t.untrust - hello_t.gsub(/./, a).untrusted?.should == true - hello_t.gsub(/./, empty).untrusted?.should == true + hello_t.gsub(/./, a).should.untrusted? + hello_t.gsub(/./, empty).should.untrusted? - hello.gsub(/./, a_t).untrusted?.should == true - hello.gsub(/./, empty_t).untrusted?.should == true - hello.gsub(//, empty_t).untrusted?.should == true + hello.gsub(/./, a_t).should.untrusted? + hello.gsub(/./, empty_t).should.untrusted? + hello.gsub(//, empty_t).should.untrusted? - hello.gsub(//.untrust, "foo").untrusted?.should == false + hello.gsub(//.untrust, "foo").should_not.untrusted? end end @@ -521,14 +521,14 @@ describe "String#gsub with pattern and block" do hello_t.untrust; a_t.untrust; empty_t.untrust - hello_t.gsub(/./) { a }.untrusted?.should == true - hello_t.gsub(/./) { empty }.untrusted?.should == true + hello_t.gsub(/./) { a }.should.untrusted? + hello_t.gsub(/./) { empty }.should.untrusted? - hello.gsub(/./) { a_t }.untrusted?.should == true - hello.gsub(/./) { empty_t }.untrusted?.should == true - hello.gsub(//) { empty_t }.untrusted?.should == true + hello.gsub(/./) { a_t }.should.untrusted? + hello.gsub(/./) { empty_t }.should.untrusted? + hello.gsub(//) { empty_t }.should.untrusted? - hello.gsub(//.untrust) { "foo" }.untrusted?.should == false + hello.gsub(//.untrust) { "foo" }.should_not.untrusted? end end @@ -594,14 +594,14 @@ describe "String#gsub! with pattern and replacement" do ruby_version_is ''...'2.7' do it "taints self if replacement is tainted" do a = "hello" - a.gsub!(/./.taint, "foo").tainted?.should == false - a.gsub!(/./, "foo".taint).tainted?.should == true + a.gsub!(/./.taint, "foo").should_not.tainted? + a.gsub!(/./, "foo".taint).should.tainted? end it "untrusts self if replacement is untrusted" do a = "hello" - a.gsub!(/./.untrust, "foo").untrusted?.should == false - a.gsub!(/./, "foo".untrust).untrusted?.should == true + a.gsub!(/./.untrust, "foo").should_not.untrusted? + a.gsub!(/./, "foo".untrust).should.untrusted? end end @@ -633,14 +633,14 @@ describe "String#gsub! with pattern and block" do ruby_version_is ''...'2.7' do it "taints self if block's result is tainted" do a = "hello" - a.gsub!(/./.taint) { "foo" }.tainted?.should == false - a.gsub!(/./) { "foo".taint }.tainted?.should == true + a.gsub!(/./.taint) { "foo" }.should_not.tainted? + a.gsub!(/./) { "foo".taint }.should.tainted? end it "untrusts self if block's result is untrusted" do a = "hello" - a.gsub!(/./.untrust) { "foo" }.untrusted?.should == false - a.gsub!(/./) { "foo".untrust }.untrusted?.should == true + a.gsub!(/./.untrust) { "foo" }.should_not.untrusted? + a.gsub!(/./) { "foo".untrust }.should.untrusted? end end diff --git a/spec/ruby/core/string/insert_spec.rb b/spec/ruby/core/string/insert_spec.rb index b26845419f..752cbb2f37 100644 --- a/spec/ruby/core/string/insert_spec.rb +++ b/spec/ruby/core/string/insert_spec.rb @@ -44,12 +44,12 @@ describe "String#insert with index, other" do ruby_version_is ''...'2.7' do it "taints self if string to insert is tainted" do str = "abcd" - str.insert(0, "T".taint).tainted?.should == true + str.insert(0, "T".taint).should.tainted? str = "abcd" other = mock('T') def other.to_str() "T".taint end - str.insert(0, other).tainted?.should == true + str.insert(0, other).should.tainted? end end diff --git a/spec/ruby/core/string/inspect_spec.rb b/spec/ruby/core/string/inspect_spec.rb index e63d89ead5..9818796c83 100644 --- a/spec/ruby/core/string/inspect_spec.rb +++ b/spec/ruby/core/string/inspect_spec.rb @@ -5,13 +5,13 @@ require_relative 'fixtures/classes' describe "String#inspect" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - "foo".taint.inspect.tainted?.should == true - "foo\n".taint.inspect.tainted?.should == true + "foo".taint.inspect.should.tainted? + "foo\n".taint.inspect.should.tainted? end it "untrusts the result if self is untrusted" do - "foo".untrust.inspect.untrusted?.should == true - "foo\n".untrust.inspect.untrusted?.should == true + "foo".untrust.inspect.should.untrusted? + "foo\n".untrust.inspect.should.untrusted? end end diff --git a/spec/ruby/core/string/ljust_spec.rb b/spec/ruby/core/string/ljust_spec.rb index f377e39775..481ef77ca8 100644 --- a/spec/ruby/core/string/ljust_spec.rb +++ b/spec/ruby/core/string/ljust_spec.rb @@ -33,11 +33,11 @@ describe "String#ljust with length, padding" do ruby_version_is ''...'2.7' do it "taints result when self or padstr is tainted" do - "x".taint.ljust(4).tainted?.should == true - "x".taint.ljust(0).tainted?.should == true - "".taint.ljust(0).tainted?.should == true - "x".taint.ljust(4, "*").tainted?.should == true - "x".ljust(4, "*".taint).tainted?.should == true + "x".taint.ljust(4).should.tainted? + "x".taint.ljust(0).should.tainted? + "".taint.ljust(0).should.tainted? + "x".taint.ljust(4, "*").should.tainted? + "x".ljust(4, "*".taint).should.tainted? end end diff --git a/spec/ruby/core/string/lstrip_spec.rb b/spec/ruby/core/string/lstrip_spec.rb index 902d660455..12c7b13200 100644 --- a/spec/ruby/core/string/lstrip_spec.rb +++ b/spec/ruby/core/string/lstrip_spec.rb @@ -16,9 +16,9 @@ describe "String#lstrip" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "".taint.lstrip.tainted?.should == true - "ok".taint.lstrip.tainted?.should == true - " ok".taint.lstrip.tainted?.should == true + "".taint.lstrip.should.tainted? + "ok".taint.lstrip.should.tainted? + " ok".taint.lstrip.should.tainted? end end end diff --git a/spec/ruby/core/string/modulo_spec.rb b/spec/ruby/core/string/modulo_spec.rb index ad4b85e3c3..dc11ced4e2 100644 --- a/spec/ruby/core/string/modulo_spec.rb +++ b/spec/ruby/core/string/modulo_spec.rb @@ -319,8 +319,8 @@ describe "String#%" do subcls_format.taint format.taint - (format % universal).tainted?.should == true - (subcls_format % universal).tainted?.should == true + (format % universal).should.tainted? + (subcls_format % universal).should.tainted? end end end @@ -583,12 +583,12 @@ describe "String#%" do obj = mock('x') def obj.inspect() "x".taint end - ("%p" % obj).tainted?.should == true + ("%p" % obj).should.tainted? obj = mock('x'); obj.taint def obj.inspect() "x" end - ("%p" % obj).tainted?.should == false + ("%p" % obj).should_not.tainted? end end @@ -622,8 +622,8 @@ describe "String#%" do ruby_version_is ''...'2.7' do it "taints result for %s when argument is tainted" do - ("%s" % "x".taint).tainted?.should == true - ("%s" % mock('x').taint).tainted?.should == true + ("%s" % "x".taint).should.tainted? + ("%s" % mock('x').taint).should.tainted? end end @@ -789,7 +789,7 @@ describe "String#%" do ruby_version_is ''...'2.7' do it "doesn't taint the result for #{format} when argument is tainted" do - (format % "5".taint).tainted?.should == false + (format % "5".taint).should_not.tainted? end end end diff --git a/spec/ruby/core/string/reverse_spec.rb b/spec/ruby/core/string/reverse_spec.rb index 30d5385c83..cf4956a528 100644 --- a/spec/ruby/core/string/reverse_spec.rb +++ b/spec/ruby/core/string/reverse_spec.rb @@ -12,8 +12,8 @@ describe "String#reverse" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - "".taint.reverse.tainted?.should == true - "m".taint.reverse.tainted?.should == true + "".taint.reverse.should.tainted? + "m".taint.reverse.should.tainted? end end diff --git a/spec/ruby/core/string/rjust_spec.rb b/spec/ruby/core/string/rjust_spec.rb index 9285ecb6a7..bf39f4fdb9 100644 --- a/spec/ruby/core/string/rjust_spec.rb +++ b/spec/ruby/core/string/rjust_spec.rb @@ -33,11 +33,11 @@ describe "String#rjust with length, padding" do ruby_version_is ''...'2.7' do it "taints result when self or padstr is tainted" do - "x".taint.rjust(4).tainted?.should == true - "x".taint.rjust(0).tainted?.should == true - "".taint.rjust(0).tainted?.should == true - "x".taint.rjust(4, "*").tainted?.should == true - "x".rjust(4, "*".taint).tainted?.should == true + "x".taint.rjust(4).should.tainted? + "x".taint.rjust(0).should.tainted? + "".taint.rjust(0).should.tainted? + "x".taint.rjust(4, "*").should.tainted? + "x".rjust(4, "*".taint).should.tainted? end end diff --git a/spec/ruby/core/string/rstrip_spec.rb b/spec/ruby/core/string/rstrip_spec.rb index 0a01ffad73..57e1867956 100644 --- a/spec/ruby/core/string/rstrip_spec.rb +++ b/spec/ruby/core/string/rstrip_spec.rb @@ -16,9 +16,9 @@ describe "String#rstrip" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "".taint.rstrip.tainted?.should == true - "ok".taint.rstrip.tainted?.should == true - "ok ".taint.rstrip.tainted?.should == true + "".taint.rstrip.should.tainted? + "ok".taint.rstrip.should.tainted? + "ok ".taint.rstrip.should.tainted? end end end diff --git a/spec/ruby/core/string/shared/chars.rb b/spec/ruby/core/string/shared/chars.rb index 9c7a4deb8b..1f045e4530 100644 --- a/spec/ruby/core/string/shared/chars.rb +++ b/spec/ruby/core/string/shared/chars.rb @@ -69,11 +69,11 @@ describe :string_chars, shared: true do str = "hello" str.send(@method) do |x| - x.tainted?.should == false + x.should_not.tainted? end str.dup.taint.send(@method) do |x| - x.tainted?.should == true + x.should.tainted? end end end diff --git a/spec/ruby/core/string/shared/concat.rb b/spec/ruby/core/string/shared/concat.rb index d127b08e9c..d6ffad7d4d 100644 --- a/spec/ruby/core/string/shared/concat.rb +++ b/spec/ruby/core/string/shared/concat.rb @@ -41,13 +41,13 @@ describe :string_concat, shared: true do ruby_version_is ''...'2.7' do it "taints self if other is tainted" do - "x".send(@method, "".taint).tainted?.should == true - "x".send(@method, "y".taint).tainted?.should == true + "x".send(@method, "".taint).should.tainted? + "x".send(@method, "y".taint).should.tainted? end it "untrusts self if other is untrusted" do - "x".send(@method, "".untrust).untrusted?.should == true - "x".send(@method, "y".untrust).untrusted?.should == true + "x".send(@method, "".untrust).should.untrusted? + "x".send(@method, "y".untrust).should.untrusted? end end diff --git a/spec/ruby/core/string/shared/each_line.rb b/spec/ruby/core/string/shared/each_line.rb index c82e63cfe8..156565ff13 100644 --- a/spec/ruby/core/string/shared/each_line.rb +++ b/spec/ruby/core/string/shared/each_line.rb @@ -42,9 +42,9 @@ describe :string_each_line, shared: true do ruby_version_is ''...'2.7' do it "taints substrings that are passed to the block if self is tainted" do - "one\ntwo\r\nthree".taint.send(@method) { |s| s.tainted?.should == true } + "one\ntwo\r\nthree".taint.send(@method) { |s| s.should.tainted? } - "x.y.".send(@method, ".".taint) { |s| s.tainted?.should == false } + "x.y.".send(@method, ".".taint) { |s| s.should_not.tainted? } end end diff --git a/spec/ruby/core/string/shared/replace.rb b/spec/ruby/core/string/shared/replace.rb index 3c5a15e12d..8dfac49f02 100644 --- a/spec/ruby/core/string/shared/replace.rb +++ b/spec/ruby/core/string/shared/replace.rb @@ -15,28 +15,28 @@ describe :string_replace, shared: true do a = "" b = "".taint a.send(@method, b) - a.tainted?.should == true + a.should.tainted? end it "does not untaint self if other is untainted" do a = "".taint b = "" a.send(@method, b) - a.tainted?.should == true + a.should.tainted? end it "untrusts self if other is untrusted" do a = "" b = "".untrust a.send(@method, b) - a.untrusted?.should == true + a.should.untrusted? end it "does not trust self if other is trusted" do a = "".untrust b = "" a.send(@method, b) - a.untrusted?.should == true + a.should.untrusted? end end diff --git a/spec/ruby/core/string/shared/slice.rb b/spec/ruby/core/string/shared/slice.rb index 1c438bc48d..6b6f37217a 100644 --- a/spec/ruby/core/string/shared/slice.rb +++ b/spec/ruby/core/string/shared/slice.rb @@ -85,9 +85,9 @@ describe :string_slice_index_length, shared: true do str = "hello world" str.taint - str.send(@method, 0,0).tainted?.should == true - str.send(@method, 0,1).tainted?.should == true - str.send(@method, 2,1).tainted?.should == true + str.send(@method, 0,0).should.tainted? + str.send(@method, 0,1).should.tainted? + str.send(@method, 2,1).should.tainted? end end @@ -243,12 +243,12 @@ describe :string_slice_range, shared: true do str = "hello world" str.taint - str.send(@method, 0..0).tainted?.should == true - str.send(@method, 0...0).tainted?.should == true - str.send(@method, 0..1).tainted?.should == true - str.send(@method, 0...1).tainted?.should == true - str.send(@method, 2..3).tainted?.should == true - str.send(@method, 2..0).tainted?.should == true + str.send(@method, 0..0).should.tainted? + str.send(@method, 0...0).should.tainted? + str.send(@method, 0..1).should.tainted? + str.send(@method, 0...1).should.tainted? + str.send(@method, 2..3).should.tainted? + str.send(@method, 2..0).should.tainted? end end @@ -338,7 +338,7 @@ describe :string_slice_regexp, shared: true do tainted_re = /./ tainted_re.taint - str.send(@method, tainted_re).tainted?.should == true + str.send(@method, tainted_re).should.tainted? end end @@ -395,9 +395,9 @@ describe :string_slice_regexp_index, shared: true do tainted_re = /(.)(.)(.)/ tainted_re.taint - str.send(@method, tainted_re, 0).tainted?.should == true - str.send(@method, tainted_re, 1).tainted?.should == true - str.send(@method, tainted_re, -1).tainted?.should == true + str.send(@method, tainted_re, 0).should.tainted? + str.send(@method, tainted_re, 1).should.tainted? + str.send(@method, tainted_re, -1).should.tainted? end end diff --git a/spec/ruby/core/string/shared/succ.rb b/spec/ruby/core/string/shared/succ.rb index 346ccee409..7ca488dd88 100644 --- a/spec/ruby/core/string/shared/succ.rb +++ b/spec/ruby/core/string/shared/succ.rb @@ -68,7 +68,7 @@ describe :string_succ, shared: true do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do ["", "a", "z", "Z", "9", "\xFF", "\xFF\xFF"].each do |s| - s.taint.send(@method).tainted?.should == true + s.taint.send(@method).should.tainted? end end end diff --git a/spec/ruby/core/string/shared/to_s.rb b/spec/ruby/core/string/shared/to_s.rb index 36283be4d0..b8c9b8ab44 100644 --- a/spec/ruby/core/string/shared/to_s.rb +++ b/spec/ruby/core/string/shared/to_s.rb @@ -13,8 +13,8 @@ describe :string_to_s, shared: true do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "x".taint.send(@method).tainted?.should == true - StringSpecs::MyString.new("x").taint.send(@method).tainted?.should == true + "x".taint.send(@method).should.tainted? + StringSpecs::MyString.new("x").taint.send(@method).should.tainted? end end end diff --git a/spec/ruby/core/string/shared/to_sym.rb b/spec/ruby/core/string/shared/to_sym.rb index 1180d64712..416f302aef 100644 --- a/spec/ruby/core/string/shared/to_sym.rb +++ b/spec/ruby/core/string/shared/to_sym.rb @@ -55,7 +55,7 @@ describe :string_to_sym, shared: true do it "raises an EncodingError for UTF-8 String containing invalid bytes" do invalid_utf8 = "\xC3" - invalid_utf8.valid_encoding?.should == false + invalid_utf8.should_not.valid_encoding? -> { invalid_utf8.send(@method) }.should raise_error(EncodingError, /invalid/) diff --git a/spec/ruby/core/string/slice_spec.rb b/spec/ruby/core/string/slice_spec.rb index a34dd1b8d4..bd0a63971b 100644 --- a/spec/ruby/core/string/slice_spec.rb +++ b/spec/ruby/core/string/slice_spec.rb @@ -99,8 +99,8 @@ describe "String#slice! with index, length" do str = "hello world" str.taint - str.slice!(0, 0).tainted?.should == true - str.slice!(2, 1).tainted?.should == true + str.slice!(0, 0).should.tainted? + str.slice!(2, 1).should.tainted? end end @@ -191,8 +191,8 @@ describe "String#slice! Range" do str = "hello world" str.taint - str.slice!(0..0).tainted?.should == true - str.slice!(2..3).tainted?.should == true + str.slice!(0..0).should.tainted? + str.slice!(2..3).should.tainted? end end @@ -288,14 +288,14 @@ describe "String#slice! with Regexp" do tainted_re = /./ tainted_re.taint - str.slice!(tainted_re).tainted?.should == true + str.slice!(tainted_re).should.tainted? end end it "doesn't taint self when regexp is tainted" do s = "hello" s.slice!(/./.taint) - s.tainted?.should == false + s.should_not.tainted? end end @@ -349,14 +349,14 @@ describe "String#slice! with Regexp, index" do tainted_re = /(.)(.)(.)/ tainted_re.taint - str.slice!(tainted_re, 1).tainted?.should == true + str.slice!(tainted_re, 1).should.tainted? end end it "doesn't taint self when regexp is tainted" do s = "hello" s.slice!(/(.)(.)/.taint, 1) - s.tainted?.should == false + s.should_not.tainted? end end diff --git a/spec/ruby/core/string/split_spec.rb b/spec/ruby/core/string/split_spec.rb index 8a740b04ca..34a50a5f13 100644 --- a/spec/ruby/core/string/split_spec.rb +++ b/spec/ruby/core/string/split_spec.rb @@ -189,11 +189,11 @@ describe "String#split with String" do ["", ".", " "].each do |pat| [-1, 0, 1, 2].each do |limit| str.dup.taint.split(pat).each do |x| - x.tainted?.should == true + x.should.tainted? end str.split(pat.dup.taint).each do |x| - x.tainted?.should == false + x.should_not.tainted? end end end diff --git a/spec/ruby/core/string/squeeze_spec.rb b/spec/ruby/core/string/squeeze_spec.rb index e54ed42b49..5a7fbb59de 100644 --- a/spec/ruby/core/string/squeeze_spec.rb +++ b/spec/ruby/core/string/squeeze_spec.rb @@ -56,11 +56,11 @@ describe "String#squeeze" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "hello".taint.squeeze("e").tainted?.should == true - "hello".taint.squeeze("a-z").tainted?.should == true + "hello".taint.squeeze("e").should.tainted? + "hello".taint.squeeze("a-z").should.tainted? - "hello".squeeze("e".taint).tainted?.should == false - "hello".squeeze("l".taint).tainted?.should == false + "hello".squeeze("e".taint).should_not.tainted? + "hello".squeeze("l".taint).should_not.tainted? end end diff --git a/spec/ruby/core/string/strip_spec.rb b/spec/ruby/core/string/strip_spec.rb index 1838e07f32..252d4a9cc3 100644 --- a/spec/ruby/core/string/strip_spec.rb +++ b/spec/ruby/core/string/strip_spec.rb @@ -15,9 +15,9 @@ describe "String#strip" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "".taint.strip.tainted?.should == true - "ok".taint.strip.tainted?.should == true - " ok ".taint.strip.tainted?.should == true + "".taint.strip.should.tainted? + "ok".taint.strip.should.tainted? + " ok ".taint.strip.should.tainted? end end end diff --git a/spec/ruby/core/string/sub_spec.rb b/spec/ruby/core/string/sub_spec.rb index f240cd8cff..80cf8622d5 100644 --- a/spec/ruby/core/string/sub_spec.rb +++ b/spec/ruby/core/string/sub_spec.rb @@ -148,14 +148,14 @@ describe "String#sub with pattern, replacement" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.sub(/./, a).tainted?.should == true - hello_t.sub(/./, empty).tainted?.should == true + hello_t.sub(/./, a).should.tainted? + hello_t.sub(/./, empty).should.tainted? - hello.sub(/./, a_t).tainted?.should == true - hello.sub(/./, empty_t).tainted?.should == true - hello.sub(//, empty_t).tainted?.should == true + hello.sub(/./, a_t).should.tainted? + hello.sub(/./, empty_t).should.tainted? + hello.sub(//, empty_t).should.tainted? - hello.sub(//.taint, "foo").tainted?.should == false + hello.sub(//.taint, "foo").should_not.tainted? end end @@ -298,14 +298,14 @@ describe "String#sub with pattern and block" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.sub(/./) { a }.tainted?.should == true - hello_t.sub(/./) { empty }.tainted?.should == true + hello_t.sub(/./) { a }.should.tainted? + hello_t.sub(/./) { empty }.should.tainted? - hello.sub(/./) { a_t }.tainted?.should == true - hello.sub(/./) { empty_t }.tainted?.should == true - hello.sub(//) { empty_t }.tainted?.should == true + hello.sub(/./) { a_t }.should.tainted? + hello.sub(/./) { empty_t }.should.tainted? + hello.sub(//) { empty_t }.should.tainted? - hello.sub(//.taint) { "foo" }.tainted?.should == false + hello.sub(//.taint) { "foo" }.should_not.tainted? end end end @@ -320,8 +320,8 @@ describe "String#sub! with pattern, replacement" do ruby_version_is ''...'2.7' do it "taints self if replacement is tainted" do a = "hello" - a.sub!(/./.taint, "foo").tainted?.should == false - a.sub!(/./, "foo".taint).tainted?.should == true + a.sub!(/./.taint, "foo").should_not.tainted? + a.sub!(/./, "foo".taint).should.tainted? end end @@ -370,8 +370,8 @@ describe "String#sub! with pattern and block" do ruby_version_is ''...'2.7' do it "taints self if block's result is tainted" do a = "hello" - a.sub!(/./.taint) { "foo" }.tainted?.should == false - a.sub!(/./) { "foo".taint }.tainted?.should == true + a.sub!(/./.taint) { "foo" }.should_not.tainted? + a.sub!(/./) { "foo".taint }.should.tainted? end end diff --git a/spec/ruby/core/string/swapcase_spec.rb b/spec/ruby/core/string/swapcase_spec.rb index d1e908d71d..0b50cc35c4 100644 --- a/spec/ruby/core/string/swapcase_spec.rb +++ b/spec/ruby/core/string/swapcase_spec.rb @@ -11,8 +11,8 @@ describe "String#swapcase" do ruby_version_is ''...'2.7' do it "taints resulting string when self is tainted" do - "".taint.swapcase.tainted?.should == true - "hello".taint.swapcase.tainted?.should == true + "".taint.swapcase.should.tainted? + "hello".taint.swapcase.should.tainted? end end diff --git a/spec/ruby/core/string/tr_s_spec.rb b/spec/ruby/core/string/tr_s_spec.rb index e004ab713c..cdf5667ea3 100644 --- a/spec/ruby/core/string/tr_s_spec.rb +++ b/spec/ruby/core/string/tr_s_spec.rb @@ -54,10 +54,10 @@ describe "String#tr_s" do ["h", "hello"].each do |str| tainted_str = str.dup.taint - tainted_str.tr_s("e", "a").tainted?.should == true + tainted_str.tr_s("e", "a").should.tainted? - str.tr_s("e".taint, "a").tainted?.should == false - str.tr_s("e", "a".taint).tainted?.should == false + str.tr_s("e".taint, "a").should_not.tainted? + str.tr_s("e", "a".taint).should_not.tainted? end end end diff --git a/spec/ruby/core/string/tr_spec.rb b/spec/ruby/core/string/tr_spec.rb index 0e4da398d5..212d06f679 100644 --- a/spec/ruby/core/string/tr_spec.rb +++ b/spec/ruby/core/string/tr_spec.rb @@ -66,10 +66,10 @@ describe "String#tr" do ["h", "hello"].each do |str| tainted_str = str.dup.taint - tainted_str.tr("e", "a").tainted?.should == true + tainted_str.tr("e", "a").should.tainted? - str.tr("e".taint, "a").tainted?.should == false - str.tr("e", "a".taint).tainted?.should == false + str.tr("e".taint, "a").should_not.tainted? + str.tr("e", "a".taint).should_not.tainted? end end end diff --git a/spec/ruby/core/string/uminus_spec.rb b/spec/ruby/core/string/uminus_spec.rb index 85b484b6df..91f91fdb1e 100644 --- a/spec/ruby/core/string/uminus_spec.rb +++ b/spec/ruby/core/string/uminus_spec.rb @@ -6,14 +6,14 @@ describe 'String#-@' do output = -input output.should equal(input) - output.frozen?.should == true + output.should.frozen? end it 'returns a frozen copy if the String is not frozen' do input = 'foo' output = -input - output.frozen?.should == true + output.should.frozen? output.should_not equal(input) output.should == 'foo' end diff --git a/spec/ruby/core/string/undump_spec.rb b/spec/ruby/core/string/undump_spec.rb index 81deb6fa58..b990aa25ee 100644 --- a/spec/ruby/core/string/undump_spec.rb +++ b/spec/ruby/core/string/undump_spec.rb @@ -5,16 +5,16 @@ require_relative 'fixtures/classes' describe "String#undump" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - '"foo"'.taint.undump.tainted?.should == true + '"foo"'.taint.undump.should.tainted? end it "untrusts the result if self is untrusted" do - '"foo"'.untrust.undump.untrusted?.should == true + '"foo"'.untrust.undump.should.untrusted? end end it "does not take into account if a string is frozen" do - '"foo"'.freeze.undump.frozen?.should == false + '"foo"'.freeze.undump.should_not.frozen? end it "always returns String instance" do diff --git a/spec/ruby/core/string/unicode_normalized_spec.rb b/spec/ruby/core/string/unicode_normalized_spec.rb index 25c810a98f..87f3740459 100644 --- a/spec/ruby/core/string/unicode_normalized_spec.rb +++ b/spec/ruby/core/string/unicode_normalized_spec.rb @@ -24,16 +24,16 @@ describe "String#unicode_normalized?" do end it "defaults to the nfc normalization form if no forms are specified" do - @nfc_normalized_str.unicode_normalized?.should == true - @nfd_normalized_str.unicode_normalized?.should == false + @nfc_normalized_str.should.unicode_normalized? + @nfd_normalized_str.should_not.unicode_normalized? end it "returns true if string is empty" do - "".unicode_normalized?.should == true + "".should.unicode_normalized? end it "returns true if string does not contain any unicode codepoints" do - "abc".unicode_normalized?.should == true + "abc".should.unicode_normalized? end it "raises an Encoding::CompatibilityError if the string is not in an unicode encoding" do diff --git a/spec/ruby/core/string/upcase_spec.rb b/spec/ruby/core/string/upcase_spec.rb index c440b1b0aa..13ebd09a95 100644 --- a/spec/ruby/core/string/upcase_spec.rb +++ b/spec/ruby/core/string/upcase_spec.rb @@ -67,9 +67,9 @@ describe "String#upcase" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "".taint.upcase.tainted?.should == true - "X".taint.upcase.tainted?.should == true - "x".taint.upcase.tainted?.should == true + "".taint.upcase.should.tainted? + "X".taint.upcase.should.tainted? + "x".taint.upcase.should.tainted? end end diff --git a/spec/ruby/core/string/uplus_spec.rb b/spec/ruby/core/string/uplus_spec.rb index a7402b4549..038b283c90 100644 --- a/spec/ruby/core/string/uplus_spec.rb +++ b/spec/ruby/core/string/uplus_spec.rb @@ -5,7 +5,7 @@ describe 'String#+@' do input = 'foo'.freeze output = +input - output.frozen?.should == false + output.should_not.frozen? output.should == 'foo' end diff --git a/spec/ruby/core/symbol/to_proc_spec.rb b/spec/ruby/core/symbol/to_proc_spec.rb index 6651022375..32f996d63c 100644 --- a/spec/ruby/core/symbol/to_proc_spec.rb +++ b/spec/ruby/core/symbol/to_proc_spec.rb @@ -15,7 +15,7 @@ describe "Symbol#to_proc" do ruby_version_is ""..."2.8" do it "returns a Proc with #lambda? false" do pr = :to_s.to_proc - pr.lambda?.should == false + pr.should_not.lambda? end it "produces a Proc with arity -1" do @@ -32,7 +32,7 @@ describe "Symbol#to_proc" do ruby_version_is "2.8" do it "returns a Proc with #lambda? true" do pr = :to_s.to_proc - pr.lambda?.should == true + pr.should.lambda? end it "produces a Proc with arity -2" do diff --git a/spec/ruby/core/systemexit/success_spec.rb b/spec/ruby/core/systemexit/success_spec.rb index 6d36509c80..ba2fd22ded 100644 --- a/spec/ruby/core/systemexit/success_spec.rb +++ b/spec/ruby/core/systemexit/success_spec.rb @@ -3,11 +3,11 @@ require_relative '../../spec_helper' describe "SystemExit#success?" do it "returns true when the status is 0" do s = SystemExit.new 0 - s.success?.should == true + s.should.success? end it "returns false when the status is not 0" do s = SystemExit.new 1 - s.success?.should == false + s.should_not.success? end end diff --git a/spec/ruby/core/thread/alive_spec.rb b/spec/ruby/core/thread/alive_spec.rb index d4ba149d87..c2f5f5371d 100644 --- a/spec/ruby/core/thread/alive_spec.rb +++ b/spec/ruby/core/thread/alive_spec.rb @@ -3,39 +3,39 @@ require_relative 'fixtures/classes' describe "Thread#alive?" do it "can check it's own status" do - ThreadSpecs.status_of_current_thread.alive?.should == true + ThreadSpecs.status_of_current_thread.should.alive? end it "describes a running thread" do - ThreadSpecs.status_of_running_thread.alive?.should == true + ThreadSpecs.status_of_running_thread.should.alive? end it "describes a sleeping thread" do - ThreadSpecs.status_of_sleeping_thread.alive?.should == true + ThreadSpecs.status_of_sleeping_thread.should.alive? end it "describes a blocked thread" do - ThreadSpecs.status_of_blocked_thread.alive?.should == true + ThreadSpecs.status_of_blocked_thread.should.alive? end it "describes a completed thread" do - ThreadSpecs.status_of_completed_thread.alive?.should == false + ThreadSpecs.status_of_completed_thread.should_not.alive? end it "describes a killed thread" do - ThreadSpecs.status_of_killed_thread.alive?.should == false + ThreadSpecs.status_of_killed_thread.should_not.alive? end it "describes a thread with an uncaught exception" do - ThreadSpecs.status_of_thread_with_uncaught_exception.alive?.should == false + ThreadSpecs.status_of_thread_with_uncaught_exception.should_not.alive? end it "describes a dying running thread" do - ThreadSpecs.status_of_dying_running_thread.alive?.should == true + ThreadSpecs.status_of_dying_running_thread.should.alive? end it "describes a dying sleeping thread" do - ThreadSpecs.status_of_dying_sleeping_thread.alive?.should == true + ThreadSpecs.status_of_dying_sleeping_thread.should.alive? end it "returns true for a killed but still running thread" do @@ -51,7 +51,7 @@ describe "Thread#alive?" do ThreadSpecs.spin_until_sleeping(t) t.kill - t.alive?.should == true + t.should.alive? exit = true t.join end diff --git a/spec/ruby/core/thread/new_spec.rb b/spec/ruby/core/thread/new_spec.rb index 3a57149381..47a836201c 100644 --- a/spec/ruby/core/thread/new_spec.rb +++ b/spec/ruby/core/thread/new_spec.rb @@ -58,13 +58,13 @@ describe "Thread.new" do m2 = Mutex.new t = Thread.new { m1.lock - m1.locked?.should == true + m1.should.locked? m2.lock - m2.locked?.should == true + m2.should.locked? } t.join - m1.locked?.should == false - m2.locked?.should == false + m1.should_not.locked? + m2.should_not.locked? end it "releases Mutexes held by the Thread when the Thread finishes, also with Mutex#synchronize" do @@ -75,9 +75,9 @@ describe "Thread.new" do m.lock } m.lock - m.locked?.should == true + m.should.locked? } t.join - m.locked?.should == false + m.should_not.locked? end end diff --git a/spec/ruby/core/thread/stop_spec.rb b/spec/ruby/core/thread/stop_spec.rb index 33cf8f7b5c..084ab46ef6 100644 --- a/spec/ruby/core/thread/stop_spec.rb +++ b/spec/ruby/core/thread/stop_spec.rb @@ -13,42 +13,42 @@ end describe "Thread#stop?" do it "can check it's own status" do - ThreadSpecs.status_of_current_thread.stop?.should == false + ThreadSpecs.status_of_current_thread.should_not.stop? end it "describes a running thread" do - ThreadSpecs.status_of_running_thread.stop?.should == false + ThreadSpecs.status_of_running_thread.should_not.stop? end it "describes a sleeping thread" do - ThreadSpecs.status_of_sleeping_thread.stop?.should == true + ThreadSpecs.status_of_sleeping_thread.should.stop? end it "describes a blocked thread" do - ThreadSpecs.status_of_blocked_thread.stop?.should == true + ThreadSpecs.status_of_blocked_thread.should.stop? end it "describes a completed thread" do - ThreadSpecs.status_of_completed_thread.stop?.should == true + ThreadSpecs.status_of_completed_thread.should.stop? end it "describes a killed thread" do - ThreadSpecs.status_of_killed_thread.stop?.should == true + ThreadSpecs.status_of_killed_thread.should.stop? end it "describes a thread with an uncaught exception" do - ThreadSpecs.status_of_thread_with_uncaught_exception.stop?.should == true + ThreadSpecs.status_of_thread_with_uncaught_exception.should.stop? end it "describes a dying running thread" do - ThreadSpecs.status_of_dying_running_thread.stop?.should == false + ThreadSpecs.status_of_dying_running_thread.should_not.stop? end it "describes a dying sleeping thread" do - ThreadSpecs.status_of_dying_sleeping_thread.stop?.should == true + ThreadSpecs.status_of_dying_sleeping_thread.should.stop? end it "describes a dying thread after sleep" do - ThreadSpecs.status_of_dying_thread_after_sleep.stop?.should == false + ThreadSpecs.status_of_dying_thread_after_sleep.should_not.stop? end end diff --git a/spec/ruby/core/time/_dump_spec.rb b/spec/ruby/core/time/_dump_spec.rb index 6941a1531f..4dc1c43cd2 100644 --- a/spec/ruby/core/time/_dump_spec.rb +++ b/spec/ruby/core/time/_dump_spec.rb @@ -15,11 +15,11 @@ describe "Time#_dump" do # http://redmine.ruby-lang.org/issues/show/627 it "preserves the GMT flag" do - @t.gmt?.should == true + @t.should.gmt? dump = @t.send(:_dump).unpack("VV").first ((dump >> 30) & 0x1).should == 1 - @local.gmt?.should == false + @local.should_not.gmt? dump = @local.send(:_dump).unpack("VV").first ((dump >> 30) & 0x1).should == 0 end diff --git a/spec/ruby/core/time/at_spec.rb b/spec/ruby/core/time/at_spec.rb index 28a3d7b34c..6f4d83f9ad 100644 --- a/spec/ruby/core/time/at_spec.rb +++ b/spec/ruby/core/time/at_spec.rb @@ -14,7 +14,7 @@ describe "Time.at" do end it "returns a non-UTC Time" do - Time.at(1184027924).utc?.should == false + Time.at(1184027924).should_not.utc? end it "returns a subclass instance on a Time subclass" do @@ -54,12 +54,12 @@ describe "Time.at" do it "returns a UTC time if the argument is UTC" do t = Time.now.getgm - Time.at(t).utc?.should == true + Time.at(t).should.utc? end it "returns a non-UTC time if the argument is non-UTC" do t = Time.now - Time.at(t).utc?.should == false + Time.at(t).should_not.utc? end it "returns a subclass instance" do diff --git a/spec/ruby/core/time/dup_spec.rb b/spec/ruby/core/time/dup_spec.rb index ee2ff7dbba..5d6621beaa 100644 --- a/spec/ruby/core/time/dup_spec.rb +++ b/spec/ruby/core/time/dup_spec.rb @@ -7,7 +7,7 @@ describe "Time#dup" do end it "copies the gmt state flag" do - Time.now.gmtime.dup.gmt?.should == true + Time.now.gmtime.dup.should.gmt? end it "returns an independent Time object" do @@ -15,7 +15,7 @@ describe "Time#dup" do t2 = t.dup t.gmtime - t2.gmt?.should == false + t2.should_not.gmt? end it "returns a subclass instance" do diff --git a/spec/ruby/core/time/friday_spec.rb b/spec/ruby/core/time/friday_spec.rb index 27f9e1dbe5..8bee7f7558 100644 --- a/spec/ruby/core/time/friday_spec.rb +++ b/spec/ruby/core/time/friday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#friday?" do it "returns true if time represents Friday" do - Time.local(2000, 1, 7).friday?.should == true + Time.local(2000, 1, 7).should.friday? end it "returns false if time doesn't represent Friday" do - Time.local(2000, 1, 1).friday?.should == false + Time.local(2000, 1, 1).should_not.friday? end end diff --git a/spec/ruby/core/time/gmt_spec.rb b/spec/ruby/core/time/gmt_spec.rb index 7e85749d5b..840f59e0e8 100644 --- a/spec/ruby/core/time/gmt_spec.rb +++ b/spec/ruby/core/time/gmt_spec.rb @@ -2,7 +2,7 @@ require_relative '../../spec_helper' describe "Time#gmt?" do it "returns true if time represents a time in UTC (GMT)" do - Time.now.gmt?.should == false - Time.now.gmtime.gmt?.should == true + Time.now.should_not.gmt? + Time.now.gmtime.should.gmt? end end diff --git a/spec/ruby/core/time/minus_spec.rb b/spec/ruby/core/time/minus_spec.rb index 65613d11e9..995dac8462 100644 --- a/spec/ruby/core/time/minus_spec.rb +++ b/spec/ruby/core/time/minus_spec.rb @@ -79,11 +79,11 @@ describe "Time#-" do end it "returns a UTC time if self is UTC" do - (Time.utc(2012) - 10).utc?.should == true + (Time.utc(2012) - 10).should.utc? end it "returns a non-UTC time if self is non-UTC" do - (Time.local(2012) - 10).utc?.should == false + (Time.local(2012) - 10).should_not.utc? end it "returns a time with the same fixed offset as self" do diff --git a/spec/ruby/core/time/monday_spec.rb b/spec/ruby/core/time/monday_spec.rb index c5c43a5c3e..47ecaeb1db 100644 --- a/spec/ruby/core/time/monday_spec.rb +++ b/spec/ruby/core/time/monday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#monday?" do it "returns true if time represents Monday" do - Time.local(2000, 1, 3).monday?.should == true + Time.local(2000, 1, 3).should.monday? end it "returns false if time doesn't represent Monday" do - Time.local(2000, 1, 1).monday?.should == false + Time.local(2000, 1, 1).should_not.monday? end end diff --git a/spec/ruby/core/time/new_spec.rb b/spec/ruby/core/time/new_spec.rb index a5cfa2a7df..3cafd46db7 100644 --- a/spec/ruby/core/time/new_spec.rb +++ b/spec/ruby/core/time/new_spec.rb @@ -15,7 +15,7 @@ end describe "Time.new with a utc_offset argument" do it "returns a non-UTC time" do - Time.new(2000, 1, 1, 0, 0, 0, 0).utc?.should == false + Time.new(2000, 1, 1, 0, 0, 0, 0).should_not.utc? end it "returns a Time with a UTC offset of the specified number of Integer seconds" do diff --git a/spec/ruby/core/time/plus_spec.rb b/spec/ruby/core/time/plus_spec.rb index 6c29baf124..c59d9a32bb 100644 --- a/spec/ruby/core/time/plus_spec.rb +++ b/spec/ruby/core/time/plus_spec.rb @@ -37,11 +37,11 @@ describe "Time#+" do end it "returns a UTC time if self is UTC" do - (Time.utc(2012) + 10).utc?.should == true + (Time.utc(2012) + 10).should.utc? end it "returns a non-UTC time if self is non-UTC" do - (Time.local(2012) + 10).utc?.should == false + (Time.local(2012) + 10).should_not.utc? end it "returns a time with the same fixed offset as self" do diff --git a/spec/ruby/core/time/saturday_spec.rb b/spec/ruby/core/time/saturday_spec.rb index 60ffea4198..0e51407366 100644 --- a/spec/ruby/core/time/saturday_spec.rb +++ b/spec/ruby/core/time/saturday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#saturday?" do it "returns true if time represents Saturday" do - Time.local(2000, 1, 1).saturday?.should == true + Time.local(2000, 1, 1).should.saturday? end it "returns false if time doesn't represent Saturday" do - Time.local(2000, 1, 2).saturday?.should == false + Time.local(2000, 1, 2).should_not.saturday? end end diff --git a/spec/ruby/core/time/sunday_spec.rb b/spec/ruby/core/time/sunday_spec.rb index 2285583579..0d46421132 100644 --- a/spec/ruby/core/time/sunday_spec.rb +++ b/spec/ruby/core/time/sunday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#sunday?" do it "returns true if time represents Sunday" do - Time.local(2000, 1, 2).sunday?.should == true + Time.local(2000, 1, 2).should.sunday? end it "returns false if time doesn't represent Sunday" do - Time.local(2000, 1, 1).sunday?.should == false + Time.local(2000, 1, 1).should_not.sunday? end end diff --git a/spec/ruby/core/time/thursday_spec.rb b/spec/ruby/core/time/thursday_spec.rb index c82d517519..c11e79d2fa 100644 --- a/spec/ruby/core/time/thursday_spec.rb +++ b/spec/ruby/core/time/thursday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#thursday?" do it "returns true if time represents Thursday" do - Time.local(2000, 1, 6).thursday?.should == true + Time.local(2000, 1, 6).should.thursday? end it "returns false if time doesn't represent Thursday" do - Time.local(2000, 1, 1).thursday?.should == false + Time.local(2000, 1, 1).should_not.thursday? end end diff --git a/spec/ruby/core/time/tuesday_spec.rb b/spec/ruby/core/time/tuesday_spec.rb index 7abbdc92c0..0e7b9e7506 100644 --- a/spec/ruby/core/time/tuesday_spec.rb +++ b/spec/ruby/core/time/tuesday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#tuesday?" do it "returns true if time represents Tuesday" do - Time.local(2000, 1, 4).tuesday?.should == true + Time.local(2000, 1, 4).should.tuesday? end it "returns false if time doesn't represent Tuesday" do - Time.local(2000, 1, 1).tuesday?.should == false + Time.local(2000, 1, 1).should_not.tuesday? end end diff --git a/spec/ruby/core/time/utc_spec.rb b/spec/ruby/core/time/utc_spec.rb index 5074c8d54d..74c17a93d1 100644 --- a/spec/ruby/core/time/utc_spec.rb +++ b/spec/ruby/core/time/utc_spec.rb @@ -5,7 +5,7 @@ require_relative 'shared/time_params' describe "Time#utc?" do it "returns true if time represents a time in UTC (GMT)" do - Time.now.utc?.should == false + Time.now.should_not.utc? end end diff --git a/spec/ruby/core/time/wednesday_spec.rb b/spec/ruby/core/time/wednesday_spec.rb index 6a52c3577b..cc686681d7 100644 --- a/spec/ruby/core/time/wednesday_spec.rb +++ b/spec/ruby/core/time/wednesday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#wednesday?" do it "returns true if time represents Wednesday" do - Time.local(2000, 1, 5).wednesday?.should == true + Time.local(2000, 1, 5).should.wednesday? end it "returns false if time doesn't represent Wednesday" do - Time.local(2000, 1, 1).wednesday?.should == false + Time.local(2000, 1, 1).should_not.wednesday? end end diff --git a/spec/ruby/core/tracepoint/disable_spec.rb b/spec/ruby/core/tracepoint/disable_spec.rb index 612ca3c25a..2ab9b987f4 100644 --- a/spec/ruby/core/tracepoint/disable_spec.rb +++ b/spec/ruby/core/tracepoint/disable_spec.rb @@ -41,7 +41,7 @@ describe 'TracePoint#disable' do begin trace.disable { enabled = trace.enabled? } enabled.should == false - trace.enabled?.should == true + trace.should.enabled? ensure trace.disable end @@ -52,7 +52,7 @@ describe 'TracePoint#disable' do trace.enable begin trace.disable { 42 }.should == 42 - trace.enabled?.should == true + trace.should.enabled? ensure trace.disable end @@ -65,7 +65,7 @@ describe 'TracePoint#disable' do trace.disable do |*args| args.should == [] end - trace.enabled?.should == true + trace.should.enabled? ensure trace.disable end diff --git a/spec/ruby/core/tracepoint/enable_spec.rb b/spec/ruby/core/tracepoint/enable_spec.rb index b0fe38c559..15eb2f1616 100644 --- a/spec/ruby/core/tracepoint/enable_spec.rb +++ b/spec/ruby/core/tracepoint/enable_spec.rb @@ -65,7 +65,7 @@ describe 'TracePoint#enable' do event_name.should equal(:line) args.should == [] end - trace.enabled?.should == false + trace.should_not.enabled? end it 'enables trace object on calling with a block if it was already enabled' do @@ -92,7 +92,7 @@ describe 'TracePoint#enable' do line_event = true } called.should == true - trace.enabled?.should == false + trace.should_not.enabled? end end diff --git a/spec/ruby/core/tracepoint/enabled_spec.rb b/spec/ruby/core/tracepoint/enabled_spec.rb index 0167d32fb0..dbc3c214c5 100644 --- a/spec/ruby/core/tracepoint/enabled_spec.rb +++ b/spec/ruby/core/tracepoint/enabled_spec.rb @@ -4,11 +4,11 @@ describe 'TracePoint#enabled?' do it 'returns true when current status of the trace is enable' do trace = TracePoint.new(:line) {} trace.enable do - trace.enabled?.should == true + trace.should.enabled? end end it 'returns false when current status of the trace is disabled' do - TracePoint.new(:line) {}.enabled?.should == false + TracePoint.new(:line) {}.should_not.enabled? end end diff --git a/spec/ruby/core/tracepoint/trace_spec.rb b/spec/ruby/core/tracepoint/trace_spec.rb index ea6c85bcc5..c39721e692 100644 --- a/spec/ruby/core/tracepoint/trace_spec.rb +++ b/spec/ruby/core/tracepoint/trace_spec.rb @@ -3,7 +3,7 @@ require_relative '../../spec_helper' describe 'TracePoint.trace' do it 'activates the trace automatically' do trace = TracePoint.trace(:line) {} - trace.enabled?.should == true + trace.should.enabled? trace.disable end end diff --git a/spec/ruby/core/true/to_s_spec.rb b/spec/ruby/core/true/to_s_spec.rb index 68b0052c5d..f26cd138e2 100644 --- a/spec/ruby/core/true/to_s_spec.rb +++ b/spec/ruby/core/true/to_s_spec.rb @@ -7,7 +7,7 @@ describe "TrueClass#to_s" do ruby_version_is "2.7" do it "returns a frozen string" do - true.to_s.frozen?.should == true + true.to_s.should.frozen? end it "always returns the same string" do |